Skip to content

Commit

Permalink
fix!: use eslint-plugin-n instead of eslint-plugin-node (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky authored Apr 1, 2022
1 parent dcf8f69 commit df03ffe
Show file tree
Hide file tree
Showing 3 changed files with 189 additions and 32 deletions.
56 changes: 28 additions & 28 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
'standard',
'prettier',
'plugin:eslint-comments/recommended',
'plugin:node/recommended',
'plugin:n/recommended',
'plugin:import/recommended',
'plugin:promise/recommended',
'plugin:ava/recommended',
Expand Down Expand Up @@ -171,33 +171,33 @@ module.exports = {
},
],

'node/no-sync': 2,
'node/callback-return': 2,
'node/exports-style': 2,
'node/global-require': 2,
'node/no-mixed-requires': 2,
'n/no-sync': 2,
'n/callback-return': 2,
'n/exports-style': 2,
'n/global-require': 2,
'n/no-mixed-requires': 2,
// Using path.join() is often not needed when using only core Node.js APIs
'node/no-path-concat': 0,
'n/no-path-concat': 0,
// TODO: remove once bug in eslint-plugin-node is fixed:
// https://github.com/mysticatea/eslint-plugin-node/issues/250
'node/no-unsupported-features/es-syntax': [
'n/no-unsupported-features/es-syntax': [
2,
{
ignores: ['modules', 'dynamicImport'],
},
],
// Browser globals should not use `require()`. Non-browser globals should
'node/prefer-global/console': 2,
'node/prefer-global/buffer': [2, 'never'],
'node/prefer-global/process': [2, 'never'],
'node/prefer-global/url-search-params': 2,
'node/prefer-global/url': 2,
'node/prefer-global/text-decoder': 2,
'node/prefer-global/text-encoder': 2,
'node/prefer-promises/fs': 2,
'node/prefer-promises/dns': 2,
'n/prefer-global/console': 2,
'n/prefer-global/buffer': [2, 'never'],
'n/prefer-global/process': [2, 'never'],
'n/prefer-global/url-search-params': 2,
'n/prefer-global/url': 2,
'n/prefer-global/text-decoder': 2,
'n/prefer-global/text-encoder': 2,
'n/prefer-promises/fs': 2,
'n/prefer-promises/dns': 2,
// This does not work well in a monorepo
'node/shebang': 0,
'n/shebang': 0,

'promise/no-callback-in-promise': 2,
'promise/no-nesting': 2,
Expand Down Expand Up @@ -330,8 +330,8 @@ module.exports = {
files: ['**/tests.{cjs,mjs,js}', '**/tests/**/*.{cjs,mjs,js}'],
rules: {
'max-lines': 0,
'node/no-unpublished-require': 0,
'node/no-missing-require': 0,
'n/no-unpublished-require': 0,
'n/no-missing-require': 0,
'unicorn/no-process-exit': 0,
'fp/no-mutating-methods': 0,
'fp/no-mutation': 0,
Expand All @@ -343,13 +343,13 @@ module.exports = {
rules: {
'max-lines': 0,
'no-magic-numbers': 0,
'node/no-unpublished-require': 0,
'n/no-unpublished-require': 0,
},
},
{
files: ['scripts/**/*.{cjs,mjs,js}'],
rules: {
'node/no-unpublished-require': 0,
'n/no-unpublished-require': 0,
},
},
{
Expand All @@ -368,16 +368,16 @@ module.exports = {

strict: 0,
'import/no-unresolved': 0,
'node/no-missing-require': 0,
'node/no-missing-import': 0,
'n/no-missing-require': 0,
'n/no-missing-import': 0,

// code blocks in markdown files have autogenerated file names
'unicorn/filename-case': 0,

// Documentation might import dependencies not in package.json
'node/no-unpublished-require': 0,
'node/no-extraneous-require': 0,
'node/no-extraneous-import': 0,
'n/no-unpublished-require': 0,
'n/no-extraneous-require': 0,
'n/no-extraneous-import': 0,
'import/no-extraneous-dependencies': 0,
},
},
Expand All @@ -401,7 +401,7 @@ module.exports = {
browser: true,
},
rules: {
'node/no-unsupported-features/es-syntax': 0,
'n/no-unsupported-features/es-syntax': 0,
'unicorn/filename-case': 0,
'unicorn/import-index': 0,
},
Expand Down
163 changes: 160 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit df03ffe

Please sign in to comment.