@ota-meshi/eslint-plugin 0.15.3 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/lib/config-builder/+astro-with-ts.d.ts +2 -0
  2. package/lib/config-builder/+astro-with-ts.js +38 -0
  3. package/lib/config-builder/+astro.d.ts +2 -0
  4. package/lib/config-builder/+astro.js +30 -0
  5. package/lib/config-builder/+eslint-plugin.d.ts +2 -0
  6. package/lib/config-builder/+eslint-plugin.js +26 -0
  7. package/lib/config-builder/+json.d.ts +2 -0
  8. package/lib/config-builder/+json.js +32 -0
  9. package/lib/config-builder/+md.d.ts +2 -0
  10. package/lib/config-builder/+md.js +44 -0
  11. package/lib/config-builder/+node.d.ts +2 -0
  12. package/lib/config-builder/+node.js +29 -0
  13. package/lib/config-builder/+package-json.d.ts +2 -0
  14. package/lib/config-builder/+package-json.js +29 -0
  15. package/lib/config-builder/+prettier.d.ts +2 -0
  16. package/lib/config-builder/+prettier.js +28 -0
  17. package/lib/config-builder/+svelte-with-ts.d.ts +2 -0
  18. package/lib/config-builder/+svelte-with-ts.js +42 -0
  19. package/lib/config-builder/+svelte.d.ts +2 -0
  20. package/lib/config-builder/+svelte.js +30 -0
  21. package/lib/config-builder/+toml.d.ts +2 -0
  22. package/lib/config-builder/+toml.js +32 -0
  23. package/lib/config-builder/+typescript.d.ts +2 -0
  24. package/lib/config-builder/+typescript.js +17 -0
  25. package/lib/config-builder/+vue2-with-ts.d.ts +2 -0
  26. package/lib/config-builder/+vue2-with-ts.js +38 -0
  27. package/lib/config-builder/+vue2.d.ts +2 -0
  28. package/lib/config-builder/+vue2.js +30 -0
  29. package/lib/config-builder/+vue3-with-ts.d.ts +2 -0
  30. package/lib/config-builder/+vue3-with-ts.js +38 -0
  31. package/lib/config-builder/+vue3.d.ts +2 -0
  32. package/lib/config-builder/+vue3.js +30 -0
  33. package/lib/config-builder/+yaml.d.ts +2 -0
  34. package/lib/config-builder/+yaml.js +32 -0
  35. package/lib/config-builder/base-plugins/eslint-comments.d.ts +2 -0
  36. package/lib/config-builder/base-plugins/eslint-comments.js +20 -0
  37. package/lib/config-builder/base-plugins/jsdoc.d.ts +2 -0
  38. package/lib/config-builder/base-plugins/jsdoc.js +20 -0
  39. package/lib/config-builder/base-plugins/regexp.d.ts +2 -0
  40. package/lib/config-builder/base-plugins/regexp.js +20 -0
  41. package/lib/config-builder/fallback.d.ts +5 -0
  42. package/lib/config-builder/fallback.js +22 -0
  43. package/lib/config-builder/index.d.ts +20 -0
  44. package/lib/config-builder/index.js +50 -0
  45. package/lib/config-builder/plugins/json-schema.d.ts +2 -0
  46. package/lib/config-builder/plugins/json-schema.js +30 -0
  47. package/lib/config-builder/plugins/ts/base-config.d.ts +2 -0
  48. package/lib/config-builder/plugins/ts/base-config.js +48 -0
  49. package/lib/config-builder/plugins/ts/index.d.ts +1 -0
  50. package/lib/config-builder/plugins/ts/index.js +5 -0
  51. package/lib/config-builder/recommended.d.ts +5 -0
  52. package/lib/config-builder/recommended.js +40 -0
  53. package/lib/config-helpers/+astro.d.ts +3 -0
  54. package/lib/config-helpers/+astro.js +5 -0
  55. package/lib/config-helpers/+eslint-plugin.d.ts +3 -0
  56. package/lib/config-helpers/+eslint-plugin.js +102 -0
  57. package/lib/config-helpers/+json.d.ts +3 -0
  58. package/lib/config-helpers/+json.js +10 -0
  59. package/lib/config-helpers/+md.d.ts +5 -0
  60. package/lib/config-helpers/+md.js +44 -0
  61. package/lib/config-helpers/+node.d.ts +11 -0
  62. package/lib/config-helpers/+node.js +25 -0
  63. package/lib/config-helpers/+package-json.d.ts +1 -0
  64. package/lib/config-helpers/+package-json.js +4 -0
  65. package/lib/config-helpers/+prettier.d.ts +3 -0
  66. package/lib/config-helpers/+prettier.js +44 -0
  67. package/lib/config-helpers/+svelte.d.ts +3 -0
  68. package/lib/config-helpers/+svelte.js +16 -0
  69. package/lib/config-helpers/+toml.d.ts +3 -0
  70. package/lib/config-helpers/+toml.js +5 -0
  71. package/lib/config-helpers/+typescript.d.ts +4 -0
  72. package/lib/config-helpers/+typescript.js +18 -0
  73. package/lib/config-helpers/+vue.d.ts +3 -0
  74. package/lib/config-helpers/+vue.js +5 -0
  75. package/lib/config-helpers/+yaml.d.ts +3 -0
  76. package/lib/config-helpers/+yaml.js +7 -0
  77. package/lib/config-helpers/base-plugins/eslint-comments.d.ts +2 -0
  78. package/lib/config-helpers/base-plugins/eslint-comments.js +7 -0
  79. package/lib/config-helpers/base-plugins/jsdoc.d.ts +2 -0
  80. package/lib/config-helpers/base-plugins/jsdoc.js +6 -0
  81. package/lib/config-helpers/base-plugins/regexp.d.ts +2 -0
  82. package/lib/config-helpers/base-plugins/regexp.js +10 -0
  83. package/lib/config-helpers/plugins/json-schema.d.ts +2 -0
  84. package/lib/config-helpers/plugins/json-schema.js +31 -0
  85. package/lib/config-helpers/plugins/ts/base-config.d.ts +2 -0
  86. package/lib/config-helpers/plugins/ts/base-config.js +116 -0
  87. package/lib/config-helpers/plugins/ts/index.d.ts +7 -0
  88. package/lib/config-helpers/plugins/ts/index.js +21 -0
  89. package/lib/config-helpers/recommended.d.ts +5 -0
  90. package/lib/config-helpers/recommended.js +240 -0
  91. package/lib/configs/+eslint-plugin.d.ts +3 -0
  92. package/lib/configs/+eslint-plugin.js +22 -95
  93. package/lib/configs/+json.d.ts +3 -0
  94. package/lib/configs/+json.js +22 -22
  95. package/lib/configs/+md.d.ts +3 -0
  96. package/lib/configs/+md.js +30 -29
  97. package/lib/configs/+node.d.ts +3 -0
  98. package/lib/configs/+node.js +23 -29
  99. package/lib/configs/+package-json.d.ts +3 -0
  100. package/lib/configs/+package-json.js +20 -20
  101. package/lib/configs/+prettier.d.ts +3 -0
  102. package/lib/configs/+prettier.js +23 -70
  103. package/lib/configs/+svelte-with-ts.d.ts +3 -0
  104. package/lib/configs/+svelte-with-ts.js +47 -25
  105. package/lib/configs/+svelte.d.ts +3 -0
  106. package/lib/configs/+svelte.js +23 -32
  107. package/lib/configs/+toml.d.ts +3 -0
  108. package/lib/configs/+toml.js +20 -18
  109. package/lib/configs/+typescript.d.ts +3 -0
  110. package/lib/configs/+typescript.js +53 -32
  111. package/lib/configs/+vue2-with-ts.d.ts +3 -0
  112. package/lib/configs/+vue2-with-ts.js +48 -25
  113. package/lib/configs/+vue2.d.ts +3 -0
  114. package/lib/configs/+vue2.js +24 -25
  115. package/lib/configs/+vue3-with-ts.d.ts +3 -0
  116. package/lib/configs/+vue3-with-ts.js +48 -25
  117. package/lib/configs/+vue3.d.ts +3 -0
  118. package/lib/configs/+vue3.js +24 -25
  119. package/lib/configs/+yaml.d.ts +3 -0
  120. package/lib/configs/+yaml.js +22 -22
  121. package/lib/configs/base-plugins/eslint-comments.d.ts +3 -0
  122. package/lib/configs/base-plugins/eslint-comments.js +7 -9
  123. package/lib/configs/base-plugins/jsdoc.d.ts +3 -0
  124. package/lib/configs/base-plugins/jsdoc.js +10 -0
  125. package/lib/configs/base-plugins/regexp.d.ts +3 -0
  126. package/lib/configs/base-plugins/regexp.js +6 -11
  127. package/lib/configs/fallback.d.ts +5 -0
  128. package/lib/configs/fallback.js +15 -0
  129. package/lib/configs/json-schema/config.d.ts +3 -0
  130. package/lib/configs/json-schema/config.js +14 -31
  131. package/lib/configs/recommended.d.ts +26 -0
  132. package/lib/configs/recommended.js +26 -255
  133. package/lib/configs/ts/base-config.d.ts +10 -0
  134. package/lib/configs/ts/base-config.js +10 -118
  135. package/lib/configs/ts/index.d.ts +2 -0
  136. package/lib/configs/ts/index.js +4 -16
  137. package/lib/index.d.ts +48 -0
  138. package/lib/index.js +15 -23
  139. package/lib/parsers/any-parser.d.ts +5 -0
  140. package/lib/parsers/any-parser.js +29 -0
  141. package/lib/rules/missing-module-for-config.d.ts +16 -0
  142. package/lib/rules/missing-module-for-config.js +35 -53
  143. package/lib/utils/find-root-dir.d.ts +1 -0
  144. package/lib/utils/find-root-dir.js +21 -18
  145. package/lib/utils/get-linters.d.ts +1 -0
  146. package/lib/utils/get-linters.js +27 -27
  147. package/lib/utils/module.d.ts +19 -0
  148. package/lib/utils/module.js +81 -59
  149. package/package.json +23 -14
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tsTestExtendRules = exports.tsTestFiles = exports.tsFiles = void 0;
4
+ exports.tsFiles = [`*.ts`, `*.mts`, `*.cts`].flatMap((p) => [
5
+ p,
6
+ `**/${p}`,
7
+ ]);
8
+ exports.tsTestFiles = [
9
+ "test/**/*.ts",
10
+ "tests/**/*.ts",
11
+ "test/**/*.mts",
12
+ "tests/**/*.mts",
13
+ "test/**/*.cts",
14
+ "tests/**/*.cts",
15
+ ];
16
+ exports.tsTestExtendRules = {
17
+ "@typescript-eslint/no-explicit-any": "off",
18
+ };
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const vueFiles: string[];
3
+ export declare const vueExtendRules: Linter.RulesRecord;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.vueExtendRules = exports.vueFiles = void 0;
4
+ exports.vueFiles = [`*.vue`].flatMap((p) => [p, `**/${p}`]);
5
+ exports.vueExtendRules = {};
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const yamlFiles: string[];
3
+ export declare const yamlExtendRules: Linter.RulesRecord;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.yamlExtendRules = exports.yamlFiles = void 0;
4
+ exports.yamlFiles = [`*.yaml`, "*.yml"].flatMap((p) => [p, `**/${p}`]);
5
+ exports.yamlExtendRules = {
6
+ "yml/require-string-key": "error",
7
+ };
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const eslintCommentsExtendRules: Linter.RulesRecord;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.eslintCommentsExtendRules = void 0;
4
+ exports.eslintCommentsExtendRules = {
5
+ "@eslint-community/eslint-comments/require-description": "error",
6
+ "@eslint-community/eslint-comments/no-unused-disable": "error",
7
+ };
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const jsdocRules: Linter.RulesRecord;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jsdocRules = void 0;
4
+ exports.jsdocRules = {
5
+ "jsdoc/require-jsdoc": "error",
6
+ };
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const regexpExtendRules: Linter.RulesRecord;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.regexpExtendRules = void 0;
4
+ exports.regexpExtendRules = {
5
+ "regexp/letter-case": ["error"],
6
+ "regexp/prefer-quantifier": "error",
7
+ "regexp/prefer-regexp-exec": "error",
8
+ "regexp/prefer-regexp-test": "error",
9
+ "regexp/sort-character-class-elements": ["error"],
10
+ };
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const jsonSchemaExtendRules: Linter.RulesRecord;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jsonSchemaExtendRules = void 0;
4
+ exports.jsonSchemaExtendRules = {
5
+ "json-schema-validator/no-invalid": [
6
+ "error",
7
+ {
8
+ schemas: [
9
+ {
10
+ fileMatch: [".eslintrc.js"],
11
+ schema: "https://json.schemastore.org/eslintrc",
12
+ },
13
+ {
14
+ fileMatch: [".prettierrc.toml"],
15
+ schema: "https://json.schemastore.org/prettierrc",
16
+ },
17
+ {
18
+ fileMatch: [
19
+ "stylelint.config.js",
20
+ "stylelint.config.cjs",
21
+ ".stylelintrc.js",
22
+ ".stylelintrc.yaml",
23
+ ".stylelintrc.yml",
24
+ ],
25
+ schema: "https://json.schemastore.org/stylelintrc",
26
+ },
27
+ ],
28
+ useSchemastoreCatalog: true,
29
+ },
30
+ ],
31
+ };
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const tsExtendRules: Linter.RulesRecord;
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tsExtendRules = void 0;
4
+ exports.tsExtendRules = {
5
+ "@typescript-eslint/array-type": "error",
6
+ "@typescript-eslint/explicit-module-boundary-types": [
7
+ "error",
8
+ { allowArgumentsExplicitlyTypedAsAny: true },
9
+ ],
10
+ "@typescript-eslint/consistent-type-imports": "error",
11
+ "@typescript-eslint/adjacent-overload-signatures": "error",
12
+ "@typescript-eslint/await-thenable": "error",
13
+ "@typescript-eslint/ban-ts-comment": "error",
14
+ "@typescript-eslint/naming-convention": [
15
+ "error",
16
+ {
17
+ selector: "default",
18
+ format: ["camelCase"],
19
+ leadingUnderscore: "allow",
20
+ trailingUnderscore: "allow",
21
+ },
22
+ {
23
+ selector: "import",
24
+ format: ["camelCase", "PascalCase", "UPPER_CASE"],
25
+ },
26
+ {
27
+ selector: "variable",
28
+ format: ["camelCase", "UPPER_CASE"],
29
+ leadingUnderscore: "allow",
30
+ trailingUnderscore: "allow",
31
+ },
32
+ {
33
+ selector: "typeLike",
34
+ format: ["PascalCase"],
35
+ },
36
+ {
37
+ selector: "memberLike",
38
+ format: ["camelCase", "UPPER_CASE"],
39
+ leadingUnderscore: "allow",
40
+ trailingUnderscore: "allow",
41
+ },
42
+ {
43
+ selector: "property",
44
+ format: null,
45
+ },
46
+ {
47
+ selector: "method",
48
+ format: null,
49
+ },
50
+ ],
51
+ "@typescript-eslint/consistent-type-assertions": "error",
52
+ "@typescript-eslint/explicit-member-accessibility": "error",
53
+ "@typescript-eslint/no-array-constructor": "error",
54
+ "@typescript-eslint/no-empty-interface": "error",
55
+ "@typescript-eslint/no-extraneous-class": "error",
56
+ "@typescript-eslint/no-floating-promises": "error",
57
+ "@typescript-eslint/no-for-in-array": "error",
58
+ "@typescript-eslint/no-inferrable-types": "error",
59
+ "@typescript-eslint/no-misused-new": "error",
60
+ "@typescript-eslint/no-misused-promises": "error",
61
+ "@typescript-eslint/parameter-properties": "error",
62
+ "@typescript-eslint/no-require-imports": "error",
63
+ "@typescript-eslint/no-this-alias": ["error", { allowDestructuring: true }],
64
+ "@typescript-eslint/no-unnecessary-qualifier": "error",
65
+ "@typescript-eslint/no-unnecessary-type-arguments": "error",
66
+ "@typescript-eslint/no-unnecessary-type-assertion": "error",
67
+ "@typescript-eslint/no-var-requires": "error",
68
+ "@typescript-eslint/prefer-function-type": "error",
69
+ "@typescript-eslint/prefer-includes": "error",
70
+ "@typescript-eslint/prefer-namespace-keyword": "error",
71
+ "@typescript-eslint/prefer-readonly": "error",
72
+ "@typescript-eslint/prefer-regexp-exec": "error",
73
+ "@typescript-eslint/prefer-string-starts-ends-with": "error",
74
+ "@typescript-eslint/restrict-plus-operands": "error",
75
+ "@typescript-eslint/require-array-sort-compare": "error",
76
+ "@typescript-eslint/triple-slash-reference": "error",
77
+ "@typescript-eslint/unbound-method": ["error", { ignoreStatic: true }],
78
+ "@typescript-eslint/unified-signatures": "error",
79
+ "prettier/prettier": "error",
80
+ // Replacements
81
+ camelcase: "off",
82
+ // "@typescript-eslint/camelcase": "error",
83
+ "no-empty-function": "off",
84
+ "@typescript-eslint/no-empty-function": "error",
85
+ "no-useless-constructor": "off",
86
+ "@typescript-eslint/no-useless-constructor": "error",
87
+ "require-await": "off",
88
+ "@typescript-eslint/require-await": "error",
89
+ "no-use-before-define": "off",
90
+ "@typescript-eslint/no-use-before-define": [
91
+ "error",
92
+ {
93
+ functions: false,
94
+ classes: true,
95
+ variables: true,
96
+ ignoreTypeReferences: true,
97
+ },
98
+ ],
99
+ "no-unused-vars": "off",
100
+ "@typescript-eslint/no-unused-vars": [
101
+ "error",
102
+ {
103
+ args: "all",
104
+ argsIgnorePattern: "^_(?:[^_].*)?$",
105
+ caughtErrors: "all",
106
+ vars: "all",
107
+ varsIgnorePattern: "^_(?:[^_].*)?$",
108
+ },
109
+ ],
110
+ "no-shadow": "off",
111
+ "@typescript-eslint/no-shadow": "error",
112
+ // Turn off unnecessary rules
113
+ "n/no-unsupported-features/es-syntax": "off",
114
+ "n/no-missing-import": "off",
115
+ "n/no-extraneous-import": "off",
116
+ };
@@ -0,0 +1,7 @@
1
+ import { tsExtendRules } from "./base-config.js";
2
+ export { tsExtendRules };
3
+ export declare const tsParserOptions: {
4
+ project: string | undefined;
5
+ extraFileExtensions: string[];
6
+ };
7
+ export declare function getProject(): string | undefined;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProject = exports.tsParserOptions = exports.tsExtendRules = void 0;
4
+ const base_config_js_1 = require("./base-config.js");
5
+ Object.defineProperty(exports, "tsExtendRules", { enumerable: true, get: function () { return base_config_js_1.tsExtendRules; } });
6
+ const module_js_1 = require("../../../utils/module.js");
7
+ exports.tsParserOptions = {
8
+ project: getProject(),
9
+ extraFileExtensions: [".vue", ".svelte", ".astro"],
10
+ };
11
+ function getProject() {
12
+ let project = undefined;
13
+ try {
14
+ project = (0, module_js_1.resolveFromCwd)("./tsconfig.json");
15
+ }
16
+ catch {
17
+ // ignore
18
+ }
19
+ return project;
20
+ }
21
+ exports.getProject = getProject;
@@ -0,0 +1,5 @@
1
+ import type { ESLint, Linter } from "eslint";
2
+ export declare const recommendedRules: Linter.RulesRecord;
3
+ export declare const recommendedTestFiles: string[];
4
+ export declare const recommendedTestRules: Linter.RulesRecord;
5
+ export declare const recommendedTestGlobals: ESLint.Globals | undefined;
@@ -0,0 +1,240 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.recommendedTestGlobals = exports.recommendedTestRules = exports.recommendedTestFiles = exports.recommendedRules = void 0;
4
+ exports.recommendedRules = {
5
+ // warns
6
+ "no-warning-comments": "warn",
7
+ "no-console": "warn",
8
+ "no-alert": "warn",
9
+ //
10
+ "no-extra-parens": "error",
11
+ "accessor-pairs": "error",
12
+ "consistent-return": "error",
13
+ eqeqeq: ["error", "always", { null: "ignore" }],
14
+ "no-eval": "error",
15
+ "no-extend-native": "error",
16
+ "no-extra-bind": "error",
17
+ "no-extra-label": "error",
18
+ "no-multi-str": "error",
19
+ "no-new-wrappers": "error",
20
+ "no-octal-escape": "error",
21
+ "no-sequences": "error",
22
+ "no-useless-call": "error",
23
+ "no-useless-concat": "error",
24
+ "no-new-object": "error",
25
+ "no-tabs": "error",
26
+ "prefer-template": "error",
27
+ "object-shorthand": "error",
28
+ "array-callback-return": "error",
29
+ camelcase: "error",
30
+ curly: "error",
31
+ "default-case": "error",
32
+ "default-param-last": "error",
33
+ "dot-notation": "error",
34
+ "for-direction": "error",
35
+ "func-style": ["error", "declaration"],
36
+ "getter-return": "error",
37
+ // "init-declarations": "error",
38
+ "linebreak-style": ["error", "unix"],
39
+ "lines-between-class-members": "error",
40
+ "max-statements-per-line": ["error", { max: 1 }],
41
+ "multiline-comment-style": ["error", "separate-lines"],
42
+ "new-cap": "error",
43
+ "no-array-constructor": "error",
44
+ "no-async-promise-executor": "error",
45
+ "no-caller": "error",
46
+ "no-case-declarations": "error",
47
+ "no-compare-neg-zero": "error",
48
+ "no-cond-assign": "error",
49
+ "no-constant-condition": "error",
50
+ "no-control-regex": "error",
51
+ "no-debugger": "error",
52
+ "no-delete-var": "error",
53
+ "no-div-regex": "error",
54
+ "no-dupe-args": "error",
55
+ "no-dupe-keys": "error",
56
+ "no-duplicate-case": "error",
57
+ "no-else-return": "error",
58
+ "no-empty": "error",
59
+ "no-empty-character-class": "error",
60
+ "no-empty-function": "error",
61
+ "no-empty-pattern": "error",
62
+ "no-ex-assign": "error",
63
+ "no-extra-boolean-cast": "error",
64
+ "no-fallthrough": "error",
65
+ "no-func-assign": "error",
66
+ "no-global-assign": "error",
67
+ "no-implicit-coercion": "error",
68
+ "no-implicit-globals": "error",
69
+ "no-implied-eval": "error",
70
+ "no-import-assign": "error",
71
+ "no-inner-declarations": ["error", "functions"],
72
+ "no-invalid-regexp": "error",
73
+ "no-invalid-this": "error",
74
+ "no-irregular-whitespace": [
75
+ "error",
76
+ {
77
+ skipComments: false,
78
+ skipRegExps: false,
79
+ skipStrings: false,
80
+ skipTemplates: false,
81
+ },
82
+ ],
83
+ "no-iterator": "error",
84
+ "no-label-var": "error",
85
+ "no-lone-blocks": "error",
86
+ "no-lonely-if": "error",
87
+ "no-loop-func": "error",
88
+ "no-misleading-character-class": "error",
89
+ "no-mixed-operators": [
90
+ "error",
91
+ {
92
+ groups: [
93
+ ["&", "|", "^", "~", "<<", ">>", ">>>"],
94
+ ["&&", "||"],
95
+ ],
96
+ },
97
+ ],
98
+ "no-new": "error",
99
+ "no-new-require": "error",
100
+ "no-obj-calls": "error",
101
+ "no-octal": "error",
102
+ "no-param-reassign": ["error", { props: false }],
103
+ "no-process-env": "error",
104
+ "no-process-exit": "error",
105
+ "no-prototype-builtins": "error",
106
+ "no-redeclare": ["error", { builtinGlobals: true }],
107
+ "no-regex-spaces": "error",
108
+ "no-restricted-properties": [
109
+ "error",
110
+ { property: "__count__" },
111
+ { property: "__noSuchMethod__" },
112
+ { property: "__parent__" },
113
+ { property: "__defineGetter__" },
114
+ { property: "__defineSetter__" },
115
+ { property: "__lookupGetter__" },
116
+ { property: "__lookupSetter__" },
117
+ ],
118
+ "no-return-assign": "error",
119
+ "no-return-await": "error",
120
+ "no-script-url": "error",
121
+ "no-self-assign": ["error", { props: true }],
122
+ "no-self-compare": "error",
123
+ "no-shadow": ["error", { builtinGlobals: true }],
124
+ "no-shadow-restricted-names": "error",
125
+ "no-sparse-arrays": "error",
126
+ "no-throw-literal": "error",
127
+ "no-undef": ["error", { typeof: true }],
128
+ "no-unexpected-multiline": "error",
129
+ "no-unmodified-loop-condition": "error",
130
+ "no-unneeded-ternary": "error",
131
+ "no-unreachable": "error",
132
+ "no-unsafe-finally": "error",
133
+ "no-unsafe-negation": ["error", { enforceForOrderingRelations: true }],
134
+ "no-unused-expressions": "error",
135
+ "no-unused-labels": "error",
136
+ "no-unused-vars": [
137
+ "error",
138
+ {
139
+ args: "all",
140
+ argsIgnorePattern: "^_(?:[^_].*)?$",
141
+ caughtErrors: "all",
142
+ vars: "all",
143
+ varsIgnorePattern: "^_(?:[^_].*)?$",
144
+ },
145
+ ],
146
+ "no-use-before-define": ["error", "nofunc"],
147
+ "no-useless-catch": "error",
148
+ "no-useless-escape": "error",
149
+ "no-useless-return": "error",
150
+ "no-void": ["error", { allowAsStatement: true }],
151
+ "no-with": "error",
152
+ "no-var": "error",
153
+ "one-var": [
154
+ "error",
155
+ {
156
+ initialized: "never",
157
+ uninitialized: "always",
158
+ },
159
+ ],
160
+ "padding-line-between-statements": [
161
+ "error",
162
+ { blankLine: "always", next: "*", prev: "directive" },
163
+ { blankLine: "always", next: "function", prev: "*" },
164
+ { blankLine: "always", next: "*", prev: "function" },
165
+ ],
166
+ "prefer-promise-reject-errors": "error",
167
+ "prefer-regex-literals": "error",
168
+ quotes: ["error", "double", { avoidEscape: true }],
169
+ radix: "error",
170
+ "require-atomic-updates": "error",
171
+ "require-await": "error",
172
+ "spaced-comment": [
173
+ "error",
174
+ "always",
175
+ {
176
+ block: {
177
+ balanced: true,
178
+ markers: [
179
+ "eslint",
180
+ "eslint-env",
181
+ "eslint-disable",
182
+ "eslint-enable",
183
+ "exported",
184
+ "globals",
185
+ "istanbul",
186
+ ],
187
+ },
188
+ line: {
189
+ exceptions: ["-", "="],
190
+ markers: [
191
+ "eslint-disable-line",
192
+ "eslint-disable-next-line",
193
+ "istanbul",
194
+ "TODO:",
195
+ "FIXME:",
196
+ ],
197
+ },
198
+ },
199
+ ],
200
+ strict: ["error", "global"],
201
+ "use-isnan": [
202
+ "error",
203
+ { enforceForIndexOf: true, enforceForSwitchCase: true },
204
+ ],
205
+ "valid-typeof": ["error", { requireStringLiterals: true }],
206
+ yoda: ["error", "never", { exceptRange: true }],
207
+ // Enabled rules as warnings.
208
+ complexity: ["warn", { max: 16 }],
209
+ "max-nested-callbacks": ["warn", { max: 4 }],
210
+ "max-params": ["warn", { max: 8 }],
211
+ };
212
+ exports.recommendedTestFiles = [
213
+ "test/**/*.js",
214
+ "tests/**/*.js",
215
+ "test/**/*.cjs",
216
+ "tests/**/*.cjs",
217
+ "test/**/*.mjs",
218
+ "tests/**/*.mjs",
219
+ "test/**/*.ts",
220
+ "tests/**/*.ts",
221
+ "test/**/*.mts",
222
+ "tests/**/*.mts",
223
+ "test/**/*.cts",
224
+ "tests/**/*.cts",
225
+ ];
226
+ exports.recommendedTestRules = {
227
+ "jsdoc/require-jsdoc": "off",
228
+ "no-console": "off",
229
+ };
230
+ exports.recommendedTestGlobals = {
231
+ after: "readonly",
232
+ afterEach: "readonly",
233
+ before: "readonly",
234
+ beforeEach: "readonly",
235
+ describe: "readonly",
236
+ it: "readonly",
237
+ mocha: "readonly",
238
+ xdescribe: "readonly",
239
+ xit: "readonly",
240
+ };
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -1,101 +1,28 @@
1
1
  "use strict";
2
-
3
- const fs = require("fs");
4
- const path = require("path");
5
- module.exports = require("../utils/module").requireOf(
6
- ["eslint-plugin-eslint-plugin"],
7
- () => ({
2
+ const module_js_1 = require("../utils/module.js");
3
+ const _eslint_plugin_js_1 = require("../config-helpers/+eslint-plugin.js");
4
+ const fallback_js_1 = require("./fallback.js");
5
+ module.exports = (0, module_js_1.requireOf)(["eslint-plugin-eslint-plugin"], () => ({
8
6
  plugins: ["eslint-plugin"],
9
7
  overrides: [
10
- {
11
- files: ["**/rules/**", "**/internal-rules/**"],
12
- extends: [
13
- require.resolve("./+node"),
14
- "plugin:eslint-plugin/recommended",
15
- ],
16
- rules: {
17
- "eslint-plugin/consistent-output": "error",
18
- "eslint-plugin/meta-property-ordering": [
19
- "error",
20
- [
21
- "deprecated",
22
- "docs",
23
- "fixable",
24
- "messages",
25
- "replacedBy",
26
- "schema",
27
- "type",
28
- ],
29
- ],
30
- "eslint-plugin/no-deprecated-context-methods": "error",
31
- "eslint-plugin/prefer-output-null": "error",
32
- "eslint-plugin/prefer-placeholders": "error",
33
- "eslint-plugin/prefer-replace-text": "error",
34
- "eslint-plugin/report-message-format": ["error", "[^a-z'\"{].*\\.$"],
35
- "eslint-plugin/require-meta-docs-description": "error",
36
- "eslint-plugin/require-meta-docs-url": [
37
- "error",
38
- { pattern: rulesDocumentUrl() },
39
- ],
40
- "eslint-plugin/require-meta-fixable": "error",
41
- "eslint-plugin/require-meta-schema": "error",
42
- "eslint-plugin/require-meta-type": "error",
43
- "eslint-plugin/test-case-property-ordering": [
44
- "error",
45
- [
46
- "filename",
47
- "code",
48
- "output",
49
- "options",
50
- "parser",
51
- "parserOptions",
52
- "globals",
53
- "env",
54
- "errors",
8
+ {
9
+ files: _eslint_plugin_js_1.eslintPluginFiles,
10
+ extends: [
11
+ require.resolve("./+node"),
12
+ "plugin:eslint-plugin/recommended",
55
13
  ],
56
- ],
57
- "eslint-plugin/test-case-shorthand-strings": "error",
14
+ rules: {
15
+ ..._eslint_plugin_js_1.eslintPluginExtendRules,
16
+ },
58
17
  },
59
- },
60
18
  ],
61
- }),
62
- );
63
-
64
- /**
65
- * The URL of rule's documentation for the `+eslint-plugin` config.
66
- * @type {string}
67
- */
68
- function rulesDocumentUrl() {
69
- try {
70
- const { version, repository } = JSON.parse(
71
- fs.readFileSync(path.join(process.cwd(), "package.json"), "utf8"),
72
- );
73
- const baseUrl = getBaseUrl(repository);
74
- if (baseUrl) {
75
- return `${baseUrl}/blob/v${version}/docs/rules/{{name}}.md`;
76
- }
77
- } catch (_error) {
78
- // ignore
79
- }
80
- return undefined;
81
- }
82
-
83
- /**
84
- * Get the base URL from a given repository information.
85
- * @param {string|{type:string,url:string}} repository The repository information.
86
- * @returns {string|null} The base URL.
87
- */
88
- function getBaseUrl(repository) {
89
- if (typeof repository === "string") {
90
- return `https://github.com/${repository}`;
91
- }
92
- if (
93
- repository &&
94
- typeof repository.url === "string" &&
95
- /^git\+.+\.git$/u.test(repository.url)
96
- ) {
97
- return repository.url.slice(4, -4);
98
- }
99
-
100
- return null;
101
- }
19
+ }), (missingList) => {
20
+ return {
21
+ overrides: [
22
+ {
23
+ files: _eslint_plugin_js_1.eslintPluginFiles,
24
+ ...(0, fallback_js_1.buildFallbackForLegacy)(missingList),
25
+ },
26
+ ],
27
+ };
28
+ });
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;