Skip to content

Commit

Permalink
Remove unused eslint plugin and swap no longer maintained plugins for…
Browse files Browse the repository at this point in the history
… community versions (#300)

* remove eslint-plugin-react-redux

* replaces dead eslint-plugin-eslint-comments with community version

* swap eslint-plugin-node for eslint-plugin-n
  • Loading branch information
grahamlangford authored Oct 18, 2024
1 parent 66608a4 commit 9631a00
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 103 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ const config = {
"no-warning-comments": "off", // Only useful if there aren't hundreds of other real warnings
"security/detect-non-literal-fs-filename": "off", // 100% false positives, we never use the `fs` module

"node/file-extension-in-import": "off",
"node/prefer-global/process": "off", // `process.env` is required by webpack
"node/prefer-global/buffer": "off",
"n/file-extension-in-import": "off",
"n/prefer-global/process": "off", // `process.env` is required by webpack
"n/prefer-global/buffer": "off",
},
overrides: [
{
Expand Down
120 changes: 95 additions & 25 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,24 @@
"test": "eslint . --ext .ts"
},
"dependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
"@shopify/eslint-plugin": "^46.0.0",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"eslint-config-prettier": "^9.1.0",
"eslint-config-xo": "^0.45.0",
"eslint-config-xo-typescript": "^5.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^28.2.0",
"eslint-plugin-jsdoc": "^50.2.2",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-n": "^17.11.1",
"eslint-plugin-no-use-extend-native": "^0.5.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^7.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-redux": "^4.1.0",
"eslint-plugin-security": "^3.0.0",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-testing-library": "^6.2.0",
Expand Down
96 changes: 24 additions & 72 deletions vendors/xo-plugins-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
// - Drop AVA
// - Restore promise plugin
// - Drop non-rule / non-plugin settings
// - replace eslint-plugin-node with its successor, eslint-plugin-n

module.exports = {
plugins: [
"no-use-extend-native",
"unicorn",
"promise",
"import",
"node",
"eslint-comments",
"n",
"@eslint-community/eslint-comments",
],
rules: {
"no-use-extend-native/no-use-extend-native": "error",
Expand Down Expand Up @@ -67,25 +68,11 @@ module.exports = {
"import/no-amd": "error",
"import/no-duplicates": "error",

// We use `unicorn/prefer-module` instead.
// 'import/no-commonjs': 'error',

// Looks useful, but too unstable at the moment
// 'import/no-deprecated': 'error',

"import/no-extraneous-dependencies": "error",
"import/no-mutable-exports": "error",
"import/no-named-as-default-member": "error",
"import/no-named-as-default": "error",

// Disabled because it's buggy and it also doesn't work with TypeScript
// 'import/no-unresolved': [
// 'error',
// {
// commonjs: false
// }
// ],

"import/order": "error",
"import/no-unassigned-import": [
"error",
Expand All @@ -104,18 +91,10 @@ module.exports = {
},
],

// Redundant with `import/no-extraneous-dependencies`.
// 'node/no-extraneous-import': 'error',
// 'node/no-extraneous-require': 'error',

// Redundant with `import/no-unresolved`.
// 'node/no-missing-import': 'error', // This rule is also buggy and doesn't support `node:`.
// 'node/no-missing-require': 'error',

"node/no-unpublished-bin": "error",
"n/no-unpublished-bin": "error",

// We have this enabled in addition to `import/extensions` as this one has an auto-fix.
"node/file-extension-in-import": [
"n/file-extension-in-import": [
"error",
"always",
{
Expand All @@ -124,62 +103,35 @@ module.exports = {
".tsx": "never",
},
],
"node/no-mixed-requires": [
"n/no-mixed-requires": [
"error",
{
grouping: true,
allowCall: true,
},
],
"node/no-new-require": "error",
"node/no-path-concat": "error",

// Disabled because they're too annoying, see:
// https://github.com/mysticatea/eslint-plugin-node/issues/105
// 'node/no-unpublished-import': [
// 'error',
// {
// allowModules: [
// 'electron',
// 'atom'
// ]
// }
// ],
// 'node/no-unpublished-require': [
// 'error',
// {
// allowModules: [
// 'electron',
// 'atom'
// ]
// }
// ],

"node/process-exit-as-throw": "error",

// Disabled as the rule doesn't exclude scripts executed with `node` but not referenced in 'bin'. See https://github.com/mysticatea/eslint-plugin-node/issues/96
// 'node/shebang': 'error',

"node/no-deprecated-api": "error",
"node/prefer-global/buffer": ["error", "never"],
"node/prefer-global/console": ["error", "always"],
"node/prefer-global/process": ["error", "never"],
"node/prefer-global/text-decoder": ["error", "always"],
"node/prefer-global/text-encoder": ["error", "always"],
"node/prefer-global/url-search-params": ["error", "always"],
"node/prefer-global/url": ["error", "always"],
"node/prefer-promises/dns": "error",
"node/prefer-promises/fs": "error",
"eslint-comments/disable-enable-pair": [
"n/no-new-require": "error",
"n/no-path-concat": "error",

"n/process-exit-as-throw": "error",

"n/no-deprecated-api": "error",
"n/prefer-global/buffer": ["error", "never"],
"n/prefer-global/console": ["error", "always"],
"n/prefer-global/process": ["error", "never"],
"n/prefer-global/text-decoder": ["error", "always"],
"n/prefer-global/text-encoder": ["error", "always"],
"n/prefer-global/url-search-params": ["error", "always"],
"n/prefer-global/url": ["error", "always"],
"n/prefer-promises/dns": "error",
"n/prefer-promises/fs": "error",
"@eslint-community/eslint-comments/disable-enable-pair": [
"error",
{
allowWholeFile: true,
},
],
"eslint-comments/no-aggregating-enable": "error",
"eslint-comments/no-duplicate-disable": "error",

// Disabled as it's already covered by the `unicorn/no-abusive-eslint-disable` rule.
// 'eslint-comments/no-unlimited-disable': 'error',
"@eslint-community/eslint-comments/no-aggregating-enable": "error",
"@eslint-community/eslint-comments/no-duplicate-disable": "error",
},
};

0 comments on commit 9631a00

Please sign in to comment.