Skip to content

Commit 8f52218

Browse files
authored
feat: switch from eslint-plugin-node to eslint-plugin-n (#8)
## Problem `eslint-plugin-node` has been [abandoned](mysticatea/eslint-plugin-node#300) for some time with no recommended replacement. ## Solution [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) is a fork that currently seems to be maintained pretty well. This updates our dependencies and config to use `eslint-plugin-n`. ## Breaking Changes Although it's basically a drop-in replacement, this will cause some breaking changes so it should be in a major release. - All config and eslint-disable comments will need to be updated from `node/` to `n/` - In my testing, this resulted in many new (true) errors because `eslint-plugin-n` has been maintained and received fixes while `eslint-plugin-node` has not. So updating will require fixing or ignoring these new errors.
1 parent 58b3c66 commit 8f52218

File tree

6 files changed

+89
-103
lines changed

6 files changed

+89
-103
lines changed

package-lock.json

Lines changed: 83 additions & 97 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"eslint-plugin-github": "^5.1.8",
1010
"eslint-plugin-import": "^2.31.0",
1111
"eslint-plugin-jest": "^28.11.0",
12-
"eslint-plugin-node": "^11.1.0",
12+
"eslint-plugin-n": "^17.18.0",
1313
"eslint-plugin-perfectionist": "^4.11.0",
1414
"eslint-plugin-promise": "^7.2.1",
1515
"eslint-plugin-react-compiler": "^19.0.0-beta-e993439-20250405",

src/config/disabled.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const disabledRulesFromPresets = {
2222

2323
// no-missing-import requires a lot of manual configuration,
2424
// and we already have TypeScript to catch missing imports
25-
"node/no-missing-import": "off",
25+
"n/no-missing-import": "off",
2626

2727
"promise/always-return": "off",
2828
"promise/no-callback-in-promise": "off",

src/config/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const main = {
2424
"plugin:jest/recommended",
2525
"plugin:import/recommended",
2626
"plugin:import/typescript",
27-
"plugin:node/recommended",
27+
"plugin:n/recommended",
2828
"plugin:promise/recommended",
2929
"plugin:react/recommended",
3030
"plugin:react-hooks/recommended",

src/config/other.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ export const otherRules = {
6969
],
7070
"no-throw-literal": "error",
7171

72-
"node/no-unsupported-features/es-syntax": [
72+
"n/no-unsupported-features/es-syntax": [
7373
"error",
7474
{
75-
// https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/no-unsupported-features/es-syntax.md#ignores
75+
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-unsupported-features/es-syntax.md#ignores
7676
ignores: ["dynamicImport", "modules"],
7777
},
7878
],

src/config/overrides.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const overrides = [
2222
"@typescript-eslint/no-non-null-assertion": "off",
2323

2424
// Allow test files to use dev dependencies
25-
"node/no-unpublished-import": "off",
25+
"n/no-unpublished-import": "off",
2626
},
2727
},
2828
{

0 commit comments

Comments
 (0)