Skip to content

Commit 4745549

Browse files
fix: use node.js recommended rules by default (#63)
1 parent 9b98e49 commit 4745549

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

configs/markdown.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ async function getMarkdownRecommendedConfig() {
6060

6161
"n/no-unpublished-import": "off",
6262

63+
"n/no-missing-import": "off",
64+
65+
"n/no-missing-require": "off",
66+
6367
"import/no-unresolved": "off",
6468

6569
"import/no-extraneous-dependencies": "off",

configs/node.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ const commonRules = {
3838
// Deprecated
3939
// "n/no-hide-core-modules": "error",
4040

41-
// From recommended
42-
// "n/no-missing-import": "error",
41+
// We have `import/no-unresolved` rule
42+
"n/no-missing-import": "off",
4343

44-
// From recommended
45-
// "n/no-missing-require": "error",
44+
// We have `import/no-unresolved` rule
45+
"n/no-missing-require": "off",
4646

4747
// No need
4848
// "n/no-mixed-requires": "error",
@@ -144,6 +144,7 @@ async function getCommonJSConfig() {
144144
import: importPlugin,
145145
},
146146
rules: {
147+
...nodeConfig.rules,
147148
...commonRules,
148149
"n/exports-style": "error",
149150
"n/no-path-concat": "error",
@@ -200,6 +201,7 @@ async function getModuleConfig() {
200201
import: importPlugin,
201202
},
202203
rules: {
204+
...nodeConfig.rules,
203205
...commonRules,
204206
"import/extensions": [
205207
"error",

eslint.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,28 @@ export default defineConfig([
1515
{
1616
files: ["./validation/commonjs-package/**/*"],
1717
extends: [configs["recommended-commonjs"]],
18+
rules: {
19+
"n/no-unpublished-require": "off",
20+
},
1821
},
1922
{
2023
files: ["./validation/module-package/**/*"],
2124
extends: [configs["recommended-module"]],
25+
rules: {
26+
"n/no-unpublished-require": "off",
27+
},
2228
},
2329
{
2430
files: ["./validation/dirty-package/**/*"],
2531
extends: [configs["recommended-dirty"]],
32+
rules: {
33+
"n/no-unpublished-require": "off",
34+
},
35+
},
36+
{
37+
files: ["./validation/hashbang.js"],
38+
rules: {
39+
"n/hashbang": "off",
40+
},
2641
},
2742
]);

0 commit comments

Comments
 (0)