@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
@@ -1,261 +1,32 @@
1
1
  "use strict";
2
-
2
+ const recommended_js_1 = require("../config-helpers/recommended.js");
3
3
  module.exports = {
4
- extends: [
5
- "eslint:recommended",
6
- require.resolve("./base-plugins/eslint-comments"),
7
- require.resolve("./base-plugins/regexp"),
8
- ],
9
- parserOptions: {
10
- sourceType: "module",
11
- ecmaVersion: 2020,
12
- },
13
- rules: {
14
- // warns
15
- "no-warning-comments": "warn",
16
- "no-console": "warn",
17
- "no-alert": "warn",
18
- //
19
- "no-extra-parens": "error",
20
- "accessor-pairs": "error",
21
- "consistent-return": "error",
22
- eqeqeq: ["error", "always", { null: "ignore" }],
23
- "no-eval": "error",
24
- "no-extend-native": "error",
25
- "no-extra-bind": "error",
26
- "no-extra-label": "error",
27
- "no-multi-str": "error",
28
- "no-new-wrappers": "error",
29
- "no-octal-escape": "error",
30
- "no-sequences": "error",
31
- "no-useless-call": "error",
32
- "no-useless-concat": "error",
33
- "no-new-object": "error",
34
- "no-tabs": "error",
35
- "require-jsdoc": "error",
36
- "prefer-template": "error",
37
- "object-shorthand": "error",
38
-
39
- "array-callback-return": "error",
40
- camelcase: "error",
41
- curly: "error",
42
- "default-case": "error",
43
- "default-param-last": "error",
44
- "dot-notation": "error",
45
- "for-direction": "error",
46
- "func-style": ["error", "declaration"],
47
- "getter-return": "error",
48
- // "init-declarations": "error",
49
- "linebreak-style": ["error", "unix"],
50
- "lines-between-class-members": "error",
51
- "max-statements-per-line": ["error", { max: 1 }],
52
- "multiline-comment-style": ["error", "separate-lines"],
53
- "new-cap": "error",
54
- "no-array-constructor": "error",
55
- "no-async-promise-executor": "error",
56
- "no-caller": "error",
57
- "no-case-declarations": "error",
58
- "no-compare-neg-zero": "error",
59
- "no-cond-assign": "error",
60
- "no-constant-condition": "error",
61
- "no-control-regex": "error",
62
- "no-debugger": "error",
63
- "no-delete-var": "error",
64
- "no-div-regex": "error",
65
- "no-dupe-args": "error",
66
- "no-dupe-keys": "error",
67
- "no-duplicate-case": "error",
68
- "no-else-return": "error",
69
- "no-empty": "error",
70
- "no-empty-character-class": "error",
71
- "no-empty-function": "error",
72
- "no-empty-pattern": "error",
73
- "no-ex-assign": "error",
74
- "no-extra-boolean-cast": "error",
75
- "no-fallthrough": "error",
76
- "no-func-assign": "error",
77
- "no-global-assign": "error",
78
- "no-implicit-coercion": "error",
79
- "no-implicit-globals": "error",
80
- "no-implied-eval": "error",
81
- "no-import-assign": "error",
82
- "no-inner-declarations": ["error", "functions"],
83
- "no-invalid-regexp": "error",
84
- "no-invalid-this": "error",
85
- "no-irregular-whitespace": [
86
- "error",
87
- {
88
- skipComments: false,
89
- skipRegExps: false,
90
- skipStrings: false,
91
- skipTemplates: false,
92
- },
93
- ],
94
- "no-iterator": "error",
95
- "no-label-var": "error",
96
- "no-lone-blocks": "error",
97
- "no-lonely-if": "error",
98
- "no-loop-func": "error",
99
- "no-misleading-character-class": "error",
100
- "no-mixed-operators": [
101
- "error",
102
- {
103
- groups: [
104
- ["&", "|", "^", "~", "<<", ">>", ">>>"],
105
- ["&&", "||"],
106
- ],
107
- },
108
- ],
109
- "no-new": "error",
110
- "no-new-require": "error",
111
- "no-obj-calls": "error",
112
- "no-octal": "error",
113
- "no-param-reassign": ["error", { props: false }],
114
- "no-process-env": "error",
115
- "no-process-exit": "error",
116
- "no-prototype-builtins": "error",
117
- "no-redeclare": ["error", { builtinGlobals: true }],
118
- "no-regex-spaces": "error",
119
- "no-restricted-properties": [
120
- "error",
121
- { property: "__count__" },
122
- { property: "__noSuchMethod__" },
123
- { property: "__parent__" },
124
- { property: "__defineGetter__" },
125
- { property: "__defineSetter__" },
126
- { property: "__lookupGetter__" },
127
- { property: "__lookupSetter__" },
128
- ],
129
- "no-return-assign": "error",
130
- "no-return-await": "error",
131
- "no-script-url": "error",
132
- "no-self-assign": ["error", { props: true }],
133
- "no-self-compare": "error",
134
- "no-shadow": ["error", { builtinGlobals: true }],
135
- "no-shadow-restricted-names": "error",
136
- "no-sparse-arrays": "error",
137
- "no-throw-literal": "error",
138
- "no-undef": ["error", { typeof: true }],
139
- "no-unexpected-multiline": "error",
140
- "no-unmodified-loop-condition": "error",
141
- "no-unneeded-ternary": "error",
142
- "no-unreachable": "error",
143
- "no-unsafe-finally": "error",
144
- "no-unsafe-negation": ["error", { enforceForOrderingRelations: true }],
145
- "no-unused-expressions": "error",
146
- "no-unused-labels": "error",
147
- "no-unused-vars": [
148
- "error",
149
- {
150
- args: "all",
151
- argsIgnorePattern: "^_(?:[^_].*)?$",
152
- caughtErrors: "all",
153
- vars: "all",
154
- varsIgnorePattern: "^_(?:[^_].*)?$",
155
- },
156
- ],
157
- "no-use-before-define": ["error", "nofunc"],
158
- "no-useless-catch": "error",
159
- "no-useless-escape": "error",
160
- "no-useless-return": "error",
161
- "no-void": ["error", { allowAsStatement: true }],
162
- "no-with": "error",
163
- "no-var": "error",
164
- "one-var": [
165
- "error",
166
- {
167
- initialized: "never",
168
- uninitialized: "always",
169
- },
170
- ],
171
- "padding-line-between-statements": [
172
- "error",
173
- { blankLine: "always", next: "*", prev: "directive" },
174
- { blankLine: "always", next: "function", prev: "*" },
175
- { blankLine: "always", next: "*", prev: "function" },
176
- ],
177
- "prefer-promise-reject-errors": "error",
178
- "prefer-regex-literals": "error",
179
- quotes: ["error", "double", { avoidEscape: true }],
180
- radix: "error",
181
- "require-atomic-updates": "error",
182
- "require-await": "error",
183
- "spaced-comment": [
184
- "error",
185
- "always",
186
- {
187
- block: {
188
- balanced: true,
189
- markers: [
190
- "eslint",
191
- "eslint-env",
192
- "eslint-disable",
193
- "eslint-enable",
194
- "exported",
195
- "globals",
196
- "istanbul",
197
- ],
4
+ extends: [
5
+ "eslint:recommended",
6
+ require.resolve("./base-plugins/eslint-comments"),
7
+ require.resolve("./base-plugins/regexp"),
8
+ require.resolve("./base-plugins/jsdoc"),
9
+ ],
10
+ parserOptions: {
11
+ sourceType: "module",
12
+ ecmaVersion: 2020,
13
+ },
14
+ rules: {
15
+ ...recommended_js_1.recommendedRules,
16
+ },
17
+ overrides: [
18
+ {
19
+ files: ["*.js", "*.mjs", "*.cjs"],
20
+ extends: [require.resolve("./json-schema/config")],
198
21
  },
199
- line: {
200
- exceptions: ["-", "="],
201
- markers: [
202
- "eslint-disable-line",
203
- "eslint-disable-next-line",
204
- "istanbul",
205
- "TODO:",
206
- "FIXME:",
207
- ],
22
+ {
23
+ files: recommended_js_1.recommendedTestFiles,
24
+ globals: {
25
+ ...recommended_js_1.recommendedTestGlobals,
26
+ },
27
+ rules: {
28
+ ...recommended_js_1.recommendedTestRules,
29
+ },
208
30
  },
209
- },
210
- ],
211
- strict: ["error", "global"],
212
- "use-isnan": [
213
- "error",
214
- { enforceForIndexOf: true, enforceForSwitchCase: true },
215
31
  ],
216
- "valid-typeof": ["error", { requireStringLiterals: true }],
217
- yoda: ["error", "never", { exceptRange: true }],
218
-
219
- // Enabled rules as warnings.
220
- complexity: ["warn", { max: 16 }],
221
- "max-nested-callbacks": ["warn", { max: 4 }],
222
- "max-params": ["warn", { max: 8 }],
223
- },
224
- overrides: [
225
- {
226
- files: ["*.js", "*.mjs", "*.cjs"],
227
- extends: [require.resolve("./json-schema/config")],
228
- },
229
- {
230
- files: [
231
- "test/**/*.js",
232
- "tests/**/*.js",
233
- "test/**/*.cjs",
234
- "tests/**/*.cjs",
235
- "test/**/*.mjs",
236
- "tests/**/*.mjs",
237
- "test/**/*.ts",
238
- "tests/**/*.ts",
239
- "test/**/*.mts",
240
- "tests/**/*.mts",
241
- "test/**/*.cts",
242
- "tests/**/*.cts",
243
- ],
244
- globals: {
245
- after: "readonly",
246
- afterEach: "readonly",
247
- before: "readonly",
248
- beforeEach: "readonly",
249
- describe: "readonly",
250
- it: "readonly",
251
- mocha: "readonly",
252
- xdescribe: "readonly",
253
- xit: "readonly",
254
- },
255
- rules: {
256
- "require-jsdoc": "off",
257
- "no-console": "off",
258
- },
259
- },
260
- ],
261
32
  };
@@ -0,0 +1,10 @@
1
+ declare const extendsArray: string[];
2
+ export { extendsArray as extends };
3
+ export declare const parserOptions: {
4
+ project: string | undefined;
5
+ extraFileExtensions: string[];
6
+ sourceType: "module";
7
+ };
8
+ export declare const rules: {
9
+ [x: string]: import("eslint").Linter.RuleEntry<any[]>;
10
+ };
@@ -1,121 +1,13 @@
1
1
  "use strict";
2
-
3
- const { getProject } = require(".");
4
-
5
- module.exports = {
6
- extends: ["plugin:@typescript-eslint/recommended"],
7
- parserOptions: {
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rules = exports.parserOptions = exports.extends = void 0;
4
+ const index_js_1 = require("../../config-helpers/plugins/ts/index.js");
5
+ const extendsArray = ["plugin:@typescript-eslint/recommended"];
6
+ exports.extends = extendsArray;
7
+ exports.parserOptions = {
8
8
  sourceType: "module",
9
- project: getProject(),
10
- extraFileExtensions: [".vue", ".svelte"],
11
- },
12
- rules: {
13
- "@typescript-eslint/array-type": "error",
14
- "@typescript-eslint/explicit-module-boundary-types": [
15
- "error",
16
- { allowArgumentsExplicitlyTypedAsAny: true },
17
- ],
18
- "@typescript-eslint/consistent-type-imports": "error",
19
-
20
- "@typescript-eslint/adjacent-overload-signatures": "error",
21
- "@typescript-eslint/await-thenable": "error",
22
- "@typescript-eslint/ban-ts-comment": "error",
23
- "@typescript-eslint/naming-convention": [
24
- "error",
25
- {
26
- selector: "default",
27
- format: ["camelCase"],
28
- leadingUnderscore: "allow",
29
- trailingUnderscore: "allow",
30
- },
31
- {
32
- selector: "import",
33
- format: ["camelCase", "PascalCase", "UPPER_CASE"],
34
- },
35
- {
36
- selector: "variable",
37
- format: ["camelCase", "UPPER_CASE"],
38
- leadingUnderscore: "allow",
39
- trailingUnderscore: "allow",
40
- },
41
- {
42
- selector: "typeLike",
43
- format: ["PascalCase"],
44
- },
45
- {
46
- selector: "memberLike",
47
- format: ["camelCase", "UPPER_CASE"],
48
- leadingUnderscore: "allow",
49
- trailingUnderscore: "allow",
50
- },
51
- {
52
- selector: "property",
53
- format: null,
54
- },
55
- {
56
- selector: "method",
57
- format: null,
58
- },
59
- ],
60
- "@typescript-eslint/consistent-type-assertions": "error",
61
- "@typescript-eslint/explicit-member-accessibility": "error",
62
- "@typescript-eslint/no-array-constructor": "error",
63
- "@typescript-eslint/no-empty-interface": "error",
64
- "@typescript-eslint/no-extraneous-class": "error",
65
- "@typescript-eslint/no-floating-promises": "error",
66
- "@typescript-eslint/no-for-in-array": "error",
67
- "@typescript-eslint/no-inferrable-types": "error",
68
- "@typescript-eslint/no-misused-new": "error",
69
- "@typescript-eslint/no-misused-promises": "error",
70
- "@typescript-eslint/parameter-properties": "error",
71
- "@typescript-eslint/no-require-imports": "error",
72
- "@typescript-eslint/no-this-alias": ["error", { allowDestructuring: true }],
73
- "@typescript-eslint/no-unnecessary-qualifier": "error",
74
- "@typescript-eslint/no-unnecessary-type-arguments": "error",
75
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
76
- "@typescript-eslint/no-var-requires": "error",
77
- "@typescript-eslint/prefer-function-type": "error",
78
- "@typescript-eslint/prefer-includes": "error",
79
- "@typescript-eslint/prefer-namespace-keyword": "error",
80
- "@typescript-eslint/prefer-readonly": "error",
81
- "@typescript-eslint/prefer-regexp-exec": "error",
82
- "@typescript-eslint/prefer-string-starts-ends-with": "error",
83
- "@typescript-eslint/restrict-plus-operands": "error",
84
- "@typescript-eslint/require-array-sort-compare": "error",
85
- "@typescript-eslint/triple-slash-reference": "error",
86
- "@typescript-eslint/unbound-method": ["error", { ignoreStatic: true }],
87
- "@typescript-eslint/unified-signatures": "error",
88
- "prettier/prettier": "error",
89
-
90
- // Replacements
91
- camelcase: "off",
92
- // "@typescript-eslint/camelcase": "error",
93
- "no-empty-function": "off",
94
- "@typescript-eslint/no-empty-function": "error",
95
- "no-useless-constructor": "off",
96
- "@typescript-eslint/no-useless-constructor": "error",
97
- "require-await": "off",
98
- "@typescript-eslint/require-await": "error",
99
- "no-use-before-define": "off",
100
- "@typescript-eslint/no-use-before-define": [
101
- "error",
102
- {
103
- functions: false,
104
- classes: true,
105
- variables: true,
106
- ignoreTypeReferences: true,
107
- },
108
- ],
109
- "no-unused-vars": "off",
110
- "@typescript-eslint/no-unused-vars": [
111
- "error",
112
- {
113
- args: "all",
114
- argsIgnorePattern: "^_(?:[^_].*)?$",
115
- caughtErrors: "all",
116
- vars: "all",
117
- varsIgnorePattern: "^_(?:[^_].*)?$",
118
- },
119
- ],
120
- },
9
+ ...index_js_1.tsParserOptions,
10
+ };
11
+ exports.rules = {
12
+ ...index_js_1.tsExtendRules,
121
13
  };
@@ -0,0 +1,2 @@
1
+ import { getProject } from "../../config-helpers/plugins/ts/index.js";
2
+ export { getProject };
@@ -1,17 +1,5 @@
1
1
  "use strict";
2
-
3
- module.exports = {
4
- getProject() {
5
- let project = undefined;
6
- try {
7
- project = require("module")
8
- .createRequire(
9
- require("path").join(process.cwd(), "__placeholder__.js"),
10
- )
11
- .resolve("./tsconfig.json");
12
- } catch {
13
- // ignore
14
- }
15
- return project;
16
- },
17
- };
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProject = void 0;
4
+ const index_js_1 = require("../../config-helpers/plugins/ts/index.js");
5
+ Object.defineProperty(exports, "getProject", { enumerable: true, get: function () { return index_js_1.getProject; } });
package/lib/index.d.ts ADDED
@@ -0,0 +1,48 @@
1
+ import type { BuildConfigOptions } from "./config-builder/index.js";
2
+ export declare function config(options?: BuildConfigOptions): import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[];
3
+ export declare const configs: {
4
+ recommended: any;
5
+ "+eslint-plugin": any;
6
+ "+json": any;
7
+ "+node": any;
8
+ "+prettier": any;
9
+ "+typescript": any;
10
+ "+vue2": any;
11
+ "+vue2-with-ts": any;
12
+ "+vue3": any;
13
+ "+vue3-with-ts": any;
14
+ "+svelte": any;
15
+ "+svelte-with-ts": any;
16
+ "+yaml": any;
17
+ "+toml": any;
18
+ "+md": any;
19
+ "+package-json": any;
20
+ };
21
+ export declare const rules: {
22
+ "missing-module-for-config": any;
23
+ };
24
+ declare const _default: {
25
+ config: typeof config;
26
+ configs: {
27
+ recommended: any;
28
+ "+eslint-plugin": any;
29
+ "+json": any;
30
+ "+node": any;
31
+ "+prettier": any;
32
+ "+typescript": any;
33
+ "+vue2": any;
34
+ "+vue2-with-ts": any;
35
+ "+vue3": any;
36
+ "+vue3-with-ts": any;
37
+ "+svelte": any;
38
+ "+svelte-with-ts": any;
39
+ "+yaml": any;
40
+ "+toml": any;
41
+ "+md": any;
42
+ "+package-json": any;
43
+ };
44
+ rules: {
45
+ "missing-module-for-config": any;
46
+ };
47
+ };
48
+ export default _default;
package/lib/index.js CHANGED
@@ -1,7 +1,12 @@
1
1
  "use strict";
2
-
3
- module.exports = {
4
- configs: {
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rules = exports.configs = exports.config = void 0;
4
+ const index_js_1 = require("./config-builder/index.js");
5
+ function config(options) {
6
+ return (0, index_js_1.buildConfig)(options || {});
7
+ }
8
+ exports.config = config;
9
+ exports.configs = {
5
10
  recommended: require("./configs/recommended"),
6
11
  "+eslint-plugin": require("./configs/+eslint-plugin"),
7
12
  "+json": require("./configs/+json"),
@@ -18,25 +23,12 @@ module.exports = {
18
23
  "+toml": require("./configs/+toml"),
19
24
  "+md": require("./configs/+md"),
20
25
  "+package-json": require("./configs/+package-json"),
21
- },
22
- rules: {
26
+ };
27
+ exports.rules = {
23
28
  "missing-module-for-config": require("./rules/missing-module-for-config"),
24
- },
25
-
26
- processors: {
27
- "missing-parser": {
28
- preprocess() {
29
- return [
30
- { text: "/* missing parser */", filename: "missing-parser.js" },
31
- ];
32
- },
33
- postprocess(messages) {
34
- return []
35
- .concat(...messages)
36
- .filter((r) => r.ruleId === "@ota-meshi/missing-module-for-config");
37
- },
38
-
39
- supportsAutofix: false,
40
- },
41
- },
29
+ };
30
+ exports.default = {
31
+ config,
32
+ configs: exports.configs,
33
+ rules: exports.rules,
42
34
  };
@@ -0,0 +1,5 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function parseForESLint(text: string, _options?: any): Linter.ESLintParseResult;
3
+ export declare const anyParser: {
4
+ parseForESLint: typeof parseForESLint;
5
+ };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.anyParser = exports.parseForESLint = void 0;
4
+ const lineBreakPattern = /\r\n|[\n\r\u2028\u2029]/u;
5
+ function parseForESLint(text, _options) {
6
+ const lines = text.split(lineBreakPattern);
7
+ return {
8
+ ast: {
9
+ type: "Program",
10
+ sourceType: "module",
11
+ body: [],
12
+ tokens: [],
13
+ comments: [],
14
+ range: [0, text.length],
15
+ loc: {
16
+ start: {
17
+ line: 1,
18
+ column: 0,
19
+ },
20
+ end: {
21
+ line: lines.length,
22
+ column: lines[lines.length - 1].length,
23
+ },
24
+ },
25
+ },
26
+ };
27
+ }
28
+ exports.parseForESLint = parseForESLint;
29
+ exports.anyParser = { parseForESLint };
@@ -0,0 +1,16 @@
1
+ import type { Rule } from "eslint";
2
+ export declare const meta: {
3
+ type: string;
4
+ docs: {
5
+ description: string;
6
+ url: string;
7
+ };
8
+ fixable: string;
9
+ schema: {
10
+ type: string;
11
+ items: {
12
+ type: string;
13
+ };
14
+ }[];
15
+ };
16
+ export declare function create(context: Rule.RuleContext): {};