Skip to content

Commit 6d9b240

Browse files
committed
fix: exported configs
1 parent defa2ce commit 6d9b240

File tree

6 files changed

+27
-26
lines changed

6 files changed

+27
-26
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// the config does not support eslint v8 yet, just replaced it with a simple config,
88
// to make the ci passing.
99
module.exports = {
10-
extends: ["eslint:recommended", "plugin:node/recommended", "plugin:eslint-plugin/recommended"],
10+
reportUnusedDisableDirectives: true,
11+
extends: ["eslint:recommended", "plugin:@weiran.zsd/node/recommended", "plugin:eslint-plugin/recommended"],
1112
env: {
1213
mocha: true,
1314
}

lib/configs/_commons.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ module.exports = {
5757
setImmediate: "readonly",
5858
},
5959
commonRules: {
60-
"node/no-deprecated-api": "error",
61-
"node/no-extraneous-import": "error",
62-
"node/no-extraneous-require": "error",
63-
"node/no-exports-assign": "error",
64-
"node/no-missing-import": "error",
65-
"node/no-missing-require": "error",
66-
"node/no-process-exit": "error",
67-
"node/no-unpublished-bin": "error",
68-
"node/no-unpublished-import": "error",
69-
"node/no-unpublished-require": "error",
70-
"node/no-unsupported-features/es-builtins": "error",
71-
"node/no-unsupported-features/es-syntax": "error",
72-
"node/no-unsupported-features/node-builtins": "error",
73-
"node/process-exit-as-throw": "error",
74-
"node/shebang": "error",
60+
"@weiran.zsd/node/no-deprecated-api": "error",
61+
"@weiran.zsd/node/no-extraneous-import": "error",
62+
"@weiran.zsd/node/no-extraneous-require": "error",
63+
"@weiran.zsd/node/no-exports-assign": "error",
64+
"@weiran.zsd/node/no-missing-import": "error",
65+
"@weiran.zsd/node/no-missing-require": "error",
66+
"@weiran.zsd/node/no-process-exit": "error",
67+
"@weiran.zsd/node/no-unpublished-bin": "error",
68+
"@weiran.zsd/node/no-unpublished-import": "error",
69+
"@weiran.zsd/node/no-unpublished-require": "error",
70+
"@weiran.zsd/node/no-unsupported-features/es-builtins": "error",
71+
"@weiran.zsd/node/no-unsupported-features/es-syntax": "error",
72+
"@weiran.zsd/node/no-unsupported-features/node-builtins": "error",
73+
"@weiran.zsd/node/process-exit-as-throw": "error",
74+
"@weiran.zsd/node/shebang": "error",
7575
},
7676
}

lib/configs/recommended-module.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ module.exports = {
1616
ecmaVersion: 2019,
1717
sourceType: "module",
1818
},
19-
plugins: ["node"],
19+
plugins: ["@weiran.zsd/node"],
2020
rules: {
2121
...commonRules,
22-
"node/no-unsupported-features/es-syntax": [
22+
"@weiran.zsd/node/no-unsupported-features/es-syntax": [
2323
"error",
2424
{ ignores: ["modules"] },
2525
],

lib/configs/recommended-script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ module.exports = {
1616
ecmaVersion: 2019,
1717
sourceType: "script",
1818
},
19-
plugins: ["node"],
19+
plugins: ["@weiran.zsd/node"],
2020
rules: {
2121
...commonRules,
22-
"node/no-unsupported-features/es-syntax": ["error", { ignores: [] }],
22+
"@weiran.zsd/node/no-unsupported-features/es-syntax": ["error", { ignores: [] }],
2323
},
2424
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"codecov": "^3.3.0",
2727
"eslint": "^8.3.0",
2828
"eslint-plugin-eslint-plugin": "^4.0.1",
29-
"eslint-plugin-node": "file:.",
29+
"@weiran.zsd/eslint-plugin-node": "file:.",
3030
"fast-glob": "^2.2.6",
3131
"globals": "^11.12.0",
3232
"mocha": "^6.1.4",

tests/lib/configs/recommended.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe("node/recommended config", () => {
1515
beforeEach(() => {
1616
process.chdir(root)
1717
linter = new ESLint({
18-
baseConfig: { extends: "plugin:node/recommended" },
18+
baseConfig: { extends: "plugin:@weiran.zsd/node/recommended" },
1919
useEslintrc: false,
2020
})
2121
})
@@ -78,7 +78,7 @@ describe("node/recommended config", () => {
7878
line: 1,
7979
message: '"foo" is not found.',
8080
nodeType: "Literal",
81-
ruleId: "node/no-missing-import",
81+
ruleId: "@weiran.zsd/node/no-missing-import",
8282
severity: 2,
8383
},
8484
])
@@ -94,7 +94,7 @@ describe("node/recommended config", () => {
9494
beforeEach(() => {
9595
process.chdir(root)
9696
linter = new ESLint({
97-
baseConfig: { extends: "plugin:node/recommended" },
97+
baseConfig: { extends: "plugin:@weiran.zsd/node/recommended" },
9898
useEslintrc: false,
9999
})
100100
})
@@ -118,7 +118,7 @@ describe("node/recommended config", () => {
118118
line: 1,
119119
message: '"foo" is not found.',
120120
nodeType: "Literal",
121-
ruleId: "node/no-missing-import",
121+
ruleId: "@weiran.zsd/node/no-missing-import",
122122
severity: 2,
123123
},
124124
])
@@ -159,7 +159,7 @@ describe("node/recommended config", () => {
159159
line: 1,
160160
message: '"foo" is not found.',
161161
nodeType: "Literal",
162-
ruleId: "node/no-missing-import",
162+
ruleId: "@weiran.zsd/node/no-missing-import",
163163
severity: 2,
164164
},
165165
])

0 commit comments

Comments
 (0)