|
1 | 1 | extends:
|
2 |
| - - 'plugin:@shopify/node' |
| 2 | + - 'plugin:n/recommended-module' |
| 3 | + |
| 4 | +env: |
| 5 | + node: true |
| 6 | + |
| 7 | +# plugin:n/recommended-module disables some globals we still want |
| 8 | +globals: |
| 9 | + __dirname: 'readonly' |
| 10 | + __filename: 'readonly' |
| 11 | + require: 'readonly' |
3 | 12 |
|
4 | 13 | rules:
|
| 14 | + # node has a consistent radix for parseInt |
5 | 15 | radix: 'off'
|
6 |
| - node/exports-style: 'warn' |
7 |
| - no-console: 'error' # this is a dupe from the base config, but shopify overrides it |
| 16 | + # we should be reading any env config into a specific config module |
| 17 | + n/no-process-env: 'error' |
| 18 | + # Enforce return upon a callback |
| 19 | + n/callback-return: ['error', ['callback', 'cb', 'next']] |
| 20 | + # Disallow require() outside of the top-level module scope |
| 21 | + n/global-require: 'error' |
| 22 | + # Enforces error handling in callbacks |
| 23 | + n/handle-callback-err: ['error', '^.*[eE]rr(or)?$'] |
| 24 | + # Disallow mixing regular variable and require declarations |
| 25 | + n/no-mixed-requires: 'error' |
| 26 | + # Disallow use of new operator with the require function |
| 27 | + n/no-new-require: 'error' |
| 28 | + # Disallow string concatenation with __dirname and __filename |
| 29 | + n/no-path-concat: 'error' |
| 30 | + # Restrict usage of specified node modules |
| 31 | + n/no-restricted-import: 'off' |
| 32 | + n/no-restricted-require: 'off' |
| 33 | + # Disallow use of synchronous methods |
| 34 | + n/no-sync: 'error' |
| 35 | + # defer to import/no-extraneous-dependencies |
| 36 | + n/no-extraneous-import: 'off' |
| 37 | + n/no-extraneous-require: 'off' |
| 38 | + # use `module.exports` for commonjs |
| 39 | + n/exports-style: ['error', 'module.exports'] |
| 40 | + # use imports instead of globals |
| 41 | + n/prefer-global/text-decoder: 'never' |
| 42 | + n/prefer-global/text-encoder: 'never' |
| 43 | + n/prefer-global/url-search-params: 'never' |
| 44 | + n/prefer-global/url: 'never' |
| 45 | + # use promise APIs |
| 46 | + n/prefer-promises/dns: 'error' |
| 47 | + n/prefer-promises/fs: 'error' |
| 48 | + # make sure callbacks pass error as 1st param |
| 49 | + node/no-callback-literal: 'error' |
0 commit comments