@storm-software/eslint 0.170.156 → 0.170.158
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.
- package/README.md +1 -1
- package/dist/index.d.mts +43 -0
- package/dist/index.mjs +44 -0
- package/dist/plugins.d.mts +15 -0
- package/dist/plugins.mjs +16 -0
- package/dist/preset.d.mts +32 -0
- package/dist/preset.mjs +213 -0
- package/dist/{types.d.cts → typegen.d.mts} +8538 -11156
- package/dist/types.d.mts +735 -0
- package/dist/types.mjs +5 -0
- package/dist/utils/correct-paths.mjs +136 -0
- package/dist/utils/find-workspace-root.mjs +83 -0
- package/dist/utils/helpers.mjs +75 -0
- package/dist/utils/package-manager.mjs +20 -0
- package/dist/utils/tsconfig.mjs +48 -0
- package/package.json +58 -79
- package/dist/index.cjs +0 -24
- package/dist/index.d.cts +0 -127
- package/dist/index.d.ts +0 -127
- package/dist/index.js +0 -7
- package/dist/preset.cjs +0 -354
- package/dist/preset.d.cts +0 -34
- package/dist/preset.d.ts +0 -34
- package/dist/preset.js +0 -344
- package/dist/types.cjs +0 -12
- package/dist/types.d.ts +0 -19537
- package/dist/types.js +0 -1
- package/dist/utils/combine.cjs +0 -8
- package/dist/utils/combine.d.cts +0 -14
- package/dist/utils/combine.d.ts +0 -14
- package/dist/utils/combine.js +0 -6
- package/dist/utils/correct-paths.cjs +0 -231
- package/dist/utils/correct-paths.d.cts +0 -30
- package/dist/utils/correct-paths.d.ts +0 -30
- package/dist/utils/correct-paths.js +0 -216
- package/dist/utils/find-workspace-root.cjs +0 -96
- package/dist/utils/find-workspace-root.d.cts +0 -16
- package/dist/utils/find-workspace-root.d.ts +0 -16
- package/dist/utils/find-workspace-root.js +0 -93
- package/dist/utils/format-config.cjs +0 -19
- package/dist/utils/format-config.d.cts +0 -5
- package/dist/utils/format-config.d.ts +0 -5
- package/dist/utils/format-config.js +0 -17
- package/dist/utils/helpers.cjs +0 -86
- package/dist/utils/helpers.d.cts +0 -55
- package/dist/utils/helpers.d.ts +0 -55
- package/dist/utils/helpers.js +0 -72
- package/dist/utils/package-manager.cjs +0 -18
- package/dist/utils/package-manager.d.cts +0 -8
- package/dist/utils/package-manager.d.ts +0 -8
- package/dist/utils/package-manager.js +0 -16
- package/dist/utils/tsconfig.cjs +0 -43
- package/dist/utils/tsconfig.d.cts +0 -25
- package/dist/utils/tsconfig.d.ts +0 -25
- package/dist/utils/tsconfig.js +0 -40
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,735 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { ConfigNames, RuleOptions } from "./typegen.mjs";
|
|
4
|
+
import { VendoredPrettierOptions } from "./vendor/prettier-types.mjs";
|
|
5
|
+
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
6
|
+
import { Linter } from "eslint";
|
|
7
|
+
import { Options } from "@storm-software/eslint-plugin-banner/rules/banner";
|
|
8
|
+
import { StylisticCustomizeOptions } from "@stylistic/eslint-plugin";
|
|
9
|
+
import { ParserOptions } from "@typescript-eslint/parser";
|
|
10
|
+
import { FlatGitignoreOptions } from "eslint-config-flat-gitignore";
|
|
11
|
+
//#region src/types.d.ts
|
|
12
|
+
type Awaitable<T> = T | Promise<T>;
|
|
13
|
+
/**
|
|
14
|
+
* Matches `@nx/enforce-module-boundaries` dependency constraint options.
|
|
15
|
+
*
|
|
16
|
+
* @see https://nx.dev/nx-api/eslint-plugin/documents/enforce-module-boundaries#dependency-constraints
|
|
17
|
+
*/
|
|
18
|
+
type DepConstraint = {
|
|
19
|
+
sourceTag: string;
|
|
20
|
+
onlyDependOnLibsWithTags?: string[];
|
|
21
|
+
notDependOnLibsWithTags?: string[];
|
|
22
|
+
allowedExternalImports?: string[];
|
|
23
|
+
bannedExternalImports?: string[];
|
|
24
|
+
} | {
|
|
25
|
+
allSourceTags: string[];
|
|
26
|
+
onlyDependOnLibsWithTags?: string[];
|
|
27
|
+
notDependOnLibsWithTags?: string[];
|
|
28
|
+
allowedExternalImports?: string[];
|
|
29
|
+
bannedExternalImports?: string[];
|
|
30
|
+
};
|
|
31
|
+
type Rules = RuleOptions;
|
|
32
|
+
type TypedFlatConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
|
|
33
|
+
/**
|
|
34
|
+
* An object containing a name-value mapping of plugin names to plugin objects. When `files` is specified, these plugins are only available to the matching files.
|
|
35
|
+
*
|
|
36
|
+
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
37
|
+
*/
|
|
38
|
+
plugins?: Record<string, any>;
|
|
39
|
+
};
|
|
40
|
+
interface OptionsFiles {
|
|
41
|
+
/**
|
|
42
|
+
* Override the `files` option to provide custom globs.
|
|
43
|
+
*/
|
|
44
|
+
files?: string[];
|
|
45
|
+
}
|
|
46
|
+
type OptionsTypescript = (OptionsTypeScriptWithTypes & OptionsOverrides) | (OptionsTypeScriptParserOptions & OptionsOverrides);
|
|
47
|
+
interface OptionsFormatters {
|
|
48
|
+
/**
|
|
49
|
+
* Enable formatting support for CSS, Less, Sass, and SCSS.
|
|
50
|
+
*
|
|
51
|
+
* Currently only support Prettier.
|
|
52
|
+
*/
|
|
53
|
+
css?: "prettier" | boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Enable formatting support for HTML.
|
|
56
|
+
*
|
|
57
|
+
* Currently only support Prettier.
|
|
58
|
+
*/
|
|
59
|
+
html?: "prettier" | boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Enable formatting support for XML.
|
|
62
|
+
*
|
|
63
|
+
* Currently only support Prettier.
|
|
64
|
+
*/
|
|
65
|
+
xml?: "prettier" | boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Enable formatting support for SVG.
|
|
68
|
+
*
|
|
69
|
+
* Currently only support Prettier.
|
|
70
|
+
*/
|
|
71
|
+
svg?: "prettier" | boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Enable formatting support for Markdown.
|
|
74
|
+
*
|
|
75
|
+
* Support both Prettier and dprint.
|
|
76
|
+
*
|
|
77
|
+
* When set to `true`, it will use Prettier.
|
|
78
|
+
*/
|
|
79
|
+
markdown?: "prettier" | "dprint" | boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Enable formatting support for GraphQL.
|
|
82
|
+
*/
|
|
83
|
+
graphql?: "prettier" | boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Custom options for Prettier.
|
|
86
|
+
*
|
|
87
|
+
* By default it's controlled by our own config.
|
|
88
|
+
*/
|
|
89
|
+
prettierOptions?: VendoredPrettierOptions;
|
|
90
|
+
/**
|
|
91
|
+
* Custom options for dprint.
|
|
92
|
+
*
|
|
93
|
+
* By default it's controlled by our own config.
|
|
94
|
+
*/
|
|
95
|
+
dprintOptions?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Enable formatting support for Astro.
|
|
98
|
+
*
|
|
99
|
+
* Currently only support Prettier.
|
|
100
|
+
*/
|
|
101
|
+
astro?: "prettier" | boolean;
|
|
102
|
+
}
|
|
103
|
+
interface OptionsComponentExts {
|
|
104
|
+
/**
|
|
105
|
+
* Additional extensions for components.
|
|
106
|
+
*
|
|
107
|
+
* @example ['vue']
|
|
108
|
+
* @defaultValue []
|
|
109
|
+
*/
|
|
110
|
+
componentExts?: string[];
|
|
111
|
+
}
|
|
112
|
+
interface OptionsUnicorn {
|
|
113
|
+
/**
|
|
114
|
+
* Include all rules recommended by `eslint-plugin-unicorn`, instead of only ones picked by Anthony.
|
|
115
|
+
*
|
|
116
|
+
* @defaultValue false
|
|
117
|
+
*/
|
|
118
|
+
allRecommended?: boolean;
|
|
119
|
+
}
|
|
120
|
+
interface OptionsTSDoc extends OptionsOverrides {
|
|
121
|
+
/**
|
|
122
|
+
* The TSDoc ESLint rule severity.
|
|
123
|
+
*
|
|
124
|
+
* @defaultValue "error"
|
|
125
|
+
*/
|
|
126
|
+
severity?: "error" | "warn" | "off";
|
|
127
|
+
/**
|
|
128
|
+
* The type of Storm Software TSDoc configuration to use.
|
|
129
|
+
*
|
|
130
|
+
* @defaultValue "recommended"
|
|
131
|
+
*/
|
|
132
|
+
type?: "base" | "typedoc" | "api-extractor" | "core" | "callouts" | "recommended";
|
|
133
|
+
/**
|
|
134
|
+
* The path to a TSDoc config file.
|
|
135
|
+
*/
|
|
136
|
+
configFile?: string;
|
|
137
|
+
}
|
|
138
|
+
interface OptionsJSDoc extends OptionsOverrides {
|
|
139
|
+
/**
|
|
140
|
+
* The JSDoc ESLint rule severity.
|
|
141
|
+
*
|
|
142
|
+
* @defaultValue "error"
|
|
143
|
+
*/
|
|
144
|
+
severity?: "error" | "warn" | "off";
|
|
145
|
+
/**
|
|
146
|
+
* Enable stylistic rules for JSDoc.
|
|
147
|
+
*/
|
|
148
|
+
stylistic?: boolean;
|
|
149
|
+
}
|
|
150
|
+
interface OptionsTypeScriptParserOptions {
|
|
151
|
+
/**
|
|
152
|
+
* When this options is provided as false, type aware rules will be **disabled**.
|
|
153
|
+
*
|
|
154
|
+
* @see https://typescript-eslint.io/linting/typed-linting/
|
|
155
|
+
*/
|
|
156
|
+
tsconfigPath: false;
|
|
157
|
+
/**
|
|
158
|
+
* Additional parser options for TypeScript.
|
|
159
|
+
*/
|
|
160
|
+
parserOptions?: Partial<ParserOptions>;
|
|
161
|
+
/**
|
|
162
|
+
* Glob patterns for files that should be type aware.
|
|
163
|
+
* @defaultValue ['**\/*.{ts,tsx}']
|
|
164
|
+
*/
|
|
165
|
+
filesTypeAware?: string[];
|
|
166
|
+
/**
|
|
167
|
+
* Glob patterns for files that should not be type aware.
|
|
168
|
+
* @defaultValue ['**\/*.md\/**', '**\/*.astro/*.ts']
|
|
169
|
+
*/
|
|
170
|
+
ignoresTypeAware?: string[];
|
|
171
|
+
}
|
|
172
|
+
interface OptionsTypeScriptWithTypes {
|
|
173
|
+
/**
|
|
174
|
+
* When this options is provided (or if `tsconfigPath` is found with {@link @storm-software/eslint/utils/tsconfig#getTsConfigPath | the getTsConfigPath function}), type aware rules will be enabled.
|
|
175
|
+
*
|
|
176
|
+
* @see https://typescript-eslint.io/linting/typed-linting/
|
|
177
|
+
*/
|
|
178
|
+
tsconfigPath?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Override type aware rules.
|
|
181
|
+
*/
|
|
182
|
+
overridesTypeAware?: TypedFlatConfigItem["rules"];
|
|
183
|
+
/**
|
|
184
|
+
* A linting style for importing types. This is applied to the "ts/consistent-type-imports" rule.
|
|
185
|
+
*
|
|
186
|
+
* - `always`: always import types
|
|
187
|
+
* - `never`: never import types
|
|
188
|
+
* - `optional`: warn to import as type but allow any import
|
|
189
|
+
* - `off`: Do not check import types
|
|
190
|
+
*
|
|
191
|
+
* @remarks
|
|
192
|
+
* When set to `true`, it will use the default value of `always`. When set to `false`, it will use the default value of `never`.
|
|
193
|
+
*
|
|
194
|
+
* @defaultValue "always"
|
|
195
|
+
*/
|
|
196
|
+
typeImports?: "always" | "never" | "optional" | "off" | boolean;
|
|
197
|
+
}
|
|
198
|
+
interface OptionsHasTypeScript {
|
|
199
|
+
typescript?: boolean;
|
|
200
|
+
}
|
|
201
|
+
interface OptionsStylistic {
|
|
202
|
+
stylistic?: boolean | StylisticConfig;
|
|
203
|
+
}
|
|
204
|
+
type StylisticConfig = Pick<StylisticCustomizeOptions, "indent" | "quotes" | "jsx" | "semi"> & {
|
|
205
|
+
lineEndings?: "unix" | "windows";
|
|
206
|
+
};
|
|
207
|
+
interface OptionsOverrides {
|
|
208
|
+
overrides?: TypedFlatConfigItem["rules"];
|
|
209
|
+
}
|
|
210
|
+
interface OptionsProjectType {
|
|
211
|
+
/**
|
|
212
|
+
* Type of the project. `lib` will enable more strict rules for libraries.
|
|
213
|
+
*
|
|
214
|
+
* @defaultValue 'app'
|
|
215
|
+
*/
|
|
216
|
+
type?: "app" | "lib";
|
|
217
|
+
}
|
|
218
|
+
interface OptionsRegExp {
|
|
219
|
+
/**
|
|
220
|
+
* Override rulelevels
|
|
221
|
+
*/
|
|
222
|
+
level?: "error" | "warn";
|
|
223
|
+
}
|
|
224
|
+
interface OptionsIsInEditor {
|
|
225
|
+
isInEditor?: boolean;
|
|
226
|
+
}
|
|
227
|
+
interface OptionsUnoCSS extends OptionsOverrides {
|
|
228
|
+
/**
|
|
229
|
+
* Enable attributify support.
|
|
230
|
+
* @defaultValue true
|
|
231
|
+
*/
|
|
232
|
+
attributify?: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Enable strict mode by throwing errors about blocklisted classes.
|
|
235
|
+
* @defaultValue false
|
|
236
|
+
*/
|
|
237
|
+
strict?: boolean;
|
|
238
|
+
}
|
|
239
|
+
interface OptionsNext extends OptionsOverrides {
|
|
240
|
+
/**
|
|
241
|
+
* Enable [core-web-vitals](https://nextjs.org/docs/app/api-reference/config/eslint#with-core-web-vitals) support.
|
|
242
|
+
*
|
|
243
|
+
* @see https://nextjs.org/docs/app/api-reference/config/eslint#with-core-web-vitals
|
|
244
|
+
*
|
|
245
|
+
* @defaultValue true
|
|
246
|
+
*/
|
|
247
|
+
coreWebVitals?: boolean;
|
|
248
|
+
/**
|
|
249
|
+
* Specify the root directory of the Next.js project for scenarios where Next.js isn't installed in your root directory (such as a monorepo).
|
|
250
|
+
*
|
|
251
|
+
* @see https://nextjs.org/docs/app/api-reference/config/eslint#specifying-a-root-directory-within-a-monorepo
|
|
252
|
+
*/
|
|
253
|
+
rootDir?: string;
|
|
254
|
+
}
|
|
255
|
+
interface OptionsGraphQL extends OptionsOverrides {
|
|
256
|
+
/**
|
|
257
|
+
* Enable schema type GraphQL ESLint rules
|
|
258
|
+
*
|
|
259
|
+
* @see https://the-guild.dev/graphql/eslint/rules
|
|
260
|
+
*
|
|
261
|
+
* @defaultValue true
|
|
262
|
+
*/
|
|
263
|
+
schema?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Enable operations type GraphQL ESLint rules
|
|
266
|
+
*
|
|
267
|
+
* @see https://the-guild.dev/graphql/eslint/rules
|
|
268
|
+
*
|
|
269
|
+
* @defaultValue true
|
|
270
|
+
*/
|
|
271
|
+
operations?: boolean;
|
|
272
|
+
/**
|
|
273
|
+
* Enable [Relay](https://relay.dev/) support.
|
|
274
|
+
*
|
|
275
|
+
* @see https://github.com/relayjs/eslint-plugin-relay
|
|
276
|
+
*
|
|
277
|
+
* @defaultValue true
|
|
278
|
+
*/
|
|
279
|
+
relay?: boolean;
|
|
280
|
+
}
|
|
281
|
+
interface OptionsStorybook extends OptionsOverrides {
|
|
282
|
+
/**
|
|
283
|
+
* A option to control the strictness of the Component Story Format (CSF) ESLint rules
|
|
284
|
+
*
|
|
285
|
+
* @see https://storybook.js.org/docs/api/csf
|
|
286
|
+
*
|
|
287
|
+
* @defaultValue "loose"
|
|
288
|
+
*/
|
|
289
|
+
csf?: "none" | "loose" | "strict";
|
|
290
|
+
}
|
|
291
|
+
interface OptionsReact extends OptionsOverrides {
|
|
292
|
+
/**
|
|
293
|
+
* Use a strict mode for React rules, which will enable more strict rules that may cause more false positives but can catch more potential issues.
|
|
294
|
+
*
|
|
295
|
+
* @defaultValue false
|
|
296
|
+
*/
|
|
297
|
+
strict?: boolean;
|
|
298
|
+
}
|
|
299
|
+
interface OptionsNxDependencyChecks extends OptionsOverrides {
|
|
300
|
+
/**
|
|
301
|
+
* List of build target names
|
|
302
|
+
*
|
|
303
|
+
* @defaultValue ['build-base', 'build']
|
|
304
|
+
*/
|
|
305
|
+
buildTargets: string[];
|
|
306
|
+
/**
|
|
307
|
+
* Disable to skip checking for missing dependencies
|
|
308
|
+
*
|
|
309
|
+
* @defaultValue true
|
|
310
|
+
*/
|
|
311
|
+
checkMissingDependencies: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* Disable to skip checking for unused dependencies
|
|
314
|
+
*
|
|
315
|
+
* @defaultValue true
|
|
316
|
+
*/
|
|
317
|
+
checkObsoleteDependencies: boolean;
|
|
318
|
+
/**
|
|
319
|
+
* Disable to skip checking if version specifier matches installed version
|
|
320
|
+
*
|
|
321
|
+
* @defaultValue true
|
|
322
|
+
*/
|
|
323
|
+
checkVersionMismatches: boolean;
|
|
324
|
+
/**
|
|
325
|
+
* List of dependencies to ignore for checks
|
|
326
|
+
*
|
|
327
|
+
* @defaultValue []
|
|
328
|
+
*/
|
|
329
|
+
ignoredDependencies: string[];
|
|
330
|
+
/**
|
|
331
|
+
* List of files to ignore when collecting dependencies. The default value will be set based on the selected executor during the generation.
|
|
332
|
+
*
|
|
333
|
+
* @defaultValue []
|
|
334
|
+
*/
|
|
335
|
+
ignoredFiles: string[];
|
|
336
|
+
/**
|
|
337
|
+
* Enable to collect dependencies of children projects
|
|
338
|
+
*
|
|
339
|
+
* @defaultValue false
|
|
340
|
+
*/
|
|
341
|
+
includeTransitiveDependencies: boolean;
|
|
342
|
+
/**
|
|
343
|
+
* Set workspace dependencies as relative file:// paths. Useful for monorepos that link via file:// in package.json files.
|
|
344
|
+
*
|
|
345
|
+
* @defaultValue false
|
|
346
|
+
*/
|
|
347
|
+
useLocalPathsForWorkspaceDependencies: boolean;
|
|
348
|
+
}
|
|
349
|
+
interface OptionsNxEnforceModuleBoundaries extends OptionsOverrides {
|
|
350
|
+
/**
|
|
351
|
+
* List of imports that should be allowed without any checks
|
|
352
|
+
*
|
|
353
|
+
* @defaultValue []
|
|
354
|
+
*/
|
|
355
|
+
allow: string[];
|
|
356
|
+
/**
|
|
357
|
+
* List of build target names
|
|
358
|
+
*
|
|
359
|
+
* @defaultValue ['build-base', 'build']
|
|
360
|
+
*/
|
|
361
|
+
buildTargets: string[];
|
|
362
|
+
/**
|
|
363
|
+
* List of dependency constraints between projects
|
|
364
|
+
*
|
|
365
|
+
* @defaultValue true
|
|
366
|
+
*/
|
|
367
|
+
depConstraints: DepConstraint[];
|
|
368
|
+
/**
|
|
369
|
+
* Enable to restrict the buildable libs from importing non-buildable libraries
|
|
370
|
+
*
|
|
371
|
+
* @defaultValue true
|
|
372
|
+
*/
|
|
373
|
+
enforceBuildableLibDependency: boolean;
|
|
374
|
+
/**
|
|
375
|
+
* Disable check for self circular dependency when project imports from itself via alias path
|
|
376
|
+
*
|
|
377
|
+
* @defaultValue false
|
|
378
|
+
*/
|
|
379
|
+
allowCircularSelfDependency: boolean;
|
|
380
|
+
/**
|
|
381
|
+
* List of project pairs that should be skipped from Circular dependencies checks, including the self-circular dependency check. E.g. ['feature-project-a', 'myapp']. Project name can be replaced by catch all * for more generic matches.
|
|
382
|
+
*
|
|
383
|
+
* @defaultValue []
|
|
384
|
+
*/
|
|
385
|
+
ignoredCircularDependencies: Array<[string, string]>;
|
|
386
|
+
/**
|
|
387
|
+
* List of imports that should be skipped for Imports of lazy-loaded libraries forbidden checks. E.g. ['@myorg/lazy-project/component/*', '@myorg/other-project']
|
|
388
|
+
*
|
|
389
|
+
* @defaultValue []
|
|
390
|
+
*/
|
|
391
|
+
checkDynamicDependenciesExceptions: string[];
|
|
392
|
+
/**
|
|
393
|
+
* Ban import of dependencies that were not specified in the root or project's package.json
|
|
394
|
+
*
|
|
395
|
+
* @defaultValue false
|
|
396
|
+
*/
|
|
397
|
+
banTransitiveDependencies: boolean;
|
|
398
|
+
/**
|
|
399
|
+
* Enable to enforce the check for banned external imports in the nested packages. Check [Dependency constraints](https://nx.dev/nx-api/eslint-plugin/documents/enforce-module-boundaries#dependency-constraints) for more information
|
|
400
|
+
*
|
|
401
|
+
* @defaultValue false
|
|
402
|
+
*/
|
|
403
|
+
checkNestedExternalImports: boolean;
|
|
404
|
+
}
|
|
405
|
+
interface OptionsNx extends OptionsOverrides {
|
|
406
|
+
/**
|
|
407
|
+
* The dependencies to not check in the `@nx/dependency-checks` rule
|
|
408
|
+
*/
|
|
409
|
+
ignoredDependencies?: string[];
|
|
410
|
+
/**
|
|
411
|
+
* The files to not check in the `@nx/dependency-checks` rule
|
|
412
|
+
*/
|
|
413
|
+
ignoredFiles?: string[];
|
|
414
|
+
/**
|
|
415
|
+
* Check for obsolete dependencies in the `@nx/dependency-checks` rule
|
|
416
|
+
*/
|
|
417
|
+
checkObsoleteDependencies?: boolean;
|
|
418
|
+
/**
|
|
419
|
+
* Enables us to discover mismatches between dependencies specified in a project's package.json and the dependencies that your project depends on.
|
|
420
|
+
*
|
|
421
|
+
* @remarks
|
|
422
|
+
* If any values are overridden here, the `ignoredDependencies`, `ignoredFiles`, and `checkObsoleteDependencies` options will be ignored.
|
|
423
|
+
*
|
|
424
|
+
* @defaultValue false
|
|
425
|
+
*/
|
|
426
|
+
depsCheck?: OptionsNxDependencyChecks | false;
|
|
427
|
+
/**
|
|
428
|
+
* The severity of the `@nx/dependency-checks` rule
|
|
429
|
+
*
|
|
430
|
+
* @defaultValue "warn"
|
|
431
|
+
*/
|
|
432
|
+
depsCheckSeverity?: "off" | "warn" | "error";
|
|
433
|
+
/**
|
|
434
|
+
* Enables us to define strict rules for accessing resources between different projects in the repository. Enforcing strict boundaries helps to prevent unplanned cross-dependencies.
|
|
435
|
+
*/
|
|
436
|
+
moduleBoundaries?: OptionsNxEnforceModuleBoundaries | false;
|
|
437
|
+
}
|
|
438
|
+
interface OptionsPnpm extends OptionsOverrides {
|
|
439
|
+
/**
|
|
440
|
+
* A list of dependencies to ignore for the `pnpm/json-enforce-catalog` rule.
|
|
441
|
+
*
|
|
442
|
+
* @defaultValue ["typescript"]
|
|
443
|
+
*/
|
|
444
|
+
ignore?: string[];
|
|
445
|
+
/**
|
|
446
|
+
* Should local workspace dependencies be ignored by the `pnpm/json-enforce-catalog` rule.
|
|
447
|
+
*
|
|
448
|
+
* @defaultValue true
|
|
449
|
+
*/
|
|
450
|
+
ignoreWorkspaceDeps?: boolean;
|
|
451
|
+
}
|
|
452
|
+
interface OptionsBun extends OptionsOverrides {
|
|
453
|
+
/**
|
|
454
|
+
* A list of dependencies to ignore for the `bun/json-enforce-catalog` rule.
|
|
455
|
+
*
|
|
456
|
+
* @defaultValue ["typescript"]
|
|
457
|
+
*/
|
|
458
|
+
ignore?: string[];
|
|
459
|
+
/**
|
|
460
|
+
* Should local workspace dependencies be ignored by the `bun/json-enforce-catalog` rule.
|
|
461
|
+
*
|
|
462
|
+
* @defaultValue true
|
|
463
|
+
*/
|
|
464
|
+
ignoreWorkspaceDeps?: boolean;
|
|
465
|
+
}
|
|
466
|
+
interface OptionsCSpell extends OptionsOverrides {
|
|
467
|
+
/**
|
|
468
|
+
* A path to a CSpell configuration file
|
|
469
|
+
*
|
|
470
|
+
* @defaultValue "./.vscode/cspell.json"
|
|
471
|
+
*/
|
|
472
|
+
configFile?: string;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* The ESLint globals property value.
|
|
476
|
+
*/
|
|
477
|
+
type ESLintGlobalsPropValue = boolean | "readonly" | "readable" | "writable" | "writeable";
|
|
478
|
+
type OptionsBanner = OptionsOverrides & Options[0];
|
|
479
|
+
interface OptionsJavascript {
|
|
480
|
+
/**
|
|
481
|
+
* An object containing a list of extra global variables to include in the configuration.
|
|
482
|
+
*/
|
|
483
|
+
globals?: Record<string, ESLintGlobalsPropValue>;
|
|
484
|
+
}
|
|
485
|
+
interface OptionsConfig extends OptionsComponentExts, OptionsJavascript, OptionsProjectType {
|
|
486
|
+
/**
|
|
487
|
+
* Options to control the generated file header banner.
|
|
488
|
+
*
|
|
489
|
+
* @see https://github.com/storm-software/eslint-plugin-banner
|
|
490
|
+
*/
|
|
491
|
+
banner?: boolean | OptionsBanner;
|
|
492
|
+
/**
|
|
493
|
+
* Enable gitignore support.
|
|
494
|
+
*
|
|
495
|
+
* Passing an object to configure the options.
|
|
496
|
+
*
|
|
497
|
+
* @see https://github.com/antfu/eslint-config-flat-gitignore
|
|
498
|
+
*
|
|
499
|
+
* @defaultValue true
|
|
500
|
+
*/
|
|
501
|
+
gitignore?: boolean | FlatGitignoreOptions;
|
|
502
|
+
/**
|
|
503
|
+
* Disable some opinionated rules to Antfu's preference.
|
|
504
|
+
*
|
|
505
|
+
* @defaultValue false
|
|
506
|
+
*/
|
|
507
|
+
lessOpinionated?: boolean;
|
|
508
|
+
/**
|
|
509
|
+
* Core rules. Can't be disabled.
|
|
510
|
+
*/
|
|
511
|
+
javascript?: OptionsOverrides;
|
|
512
|
+
/**
|
|
513
|
+
* Enable cspell rules.
|
|
514
|
+
*
|
|
515
|
+
* Requires installing:
|
|
516
|
+
* - `@cspell/eslint-plugin`
|
|
517
|
+
*
|
|
518
|
+
* @defaultValue true
|
|
519
|
+
*/
|
|
520
|
+
cspell?: boolean | OptionsCSpell;
|
|
521
|
+
/**
|
|
522
|
+
* Enable TypeScript support.
|
|
523
|
+
*
|
|
524
|
+
* Passing an object to enable TypeScript Language Server support.
|
|
525
|
+
*
|
|
526
|
+
* @defaultValue auto-detect based on the dependencies
|
|
527
|
+
*/
|
|
528
|
+
typescript?: boolean | OptionsTypescript;
|
|
529
|
+
/**
|
|
530
|
+
* Enable Nx monorepo support.
|
|
531
|
+
*/
|
|
532
|
+
nx?: OptionsNx;
|
|
533
|
+
/**
|
|
534
|
+
* Enable PNPM related rules.
|
|
535
|
+
*
|
|
536
|
+
* Requires installing:
|
|
537
|
+
* - `@storm-software/eslint-plugin-pnpm`
|
|
538
|
+
*
|
|
539
|
+
* @remarks
|
|
540
|
+
* If the package manager is detected to be Bun, this option will be disabled.
|
|
541
|
+
*
|
|
542
|
+
* @see https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm
|
|
543
|
+
*
|
|
544
|
+
* @defaultValue true
|
|
545
|
+
*/
|
|
546
|
+
pnpm?: boolean | OptionsPnpm;
|
|
547
|
+
/**
|
|
548
|
+
* Enable Bun related rules.
|
|
549
|
+
*
|
|
550
|
+
* Requires installing:
|
|
551
|
+
* - `@storm-software/eslint-plugin-bun`
|
|
552
|
+
*
|
|
553
|
+
* @remarks
|
|
554
|
+
* If the package manager is detected to be PNPM, this option will be disabled.
|
|
555
|
+
*
|
|
556
|
+
* @see https://github.com/oven-sh/bun-plugin-eslint
|
|
557
|
+
*
|
|
558
|
+
* @defaultValue false
|
|
559
|
+
*/
|
|
560
|
+
bun?: boolean | OptionsBun;
|
|
561
|
+
/**
|
|
562
|
+
* Enable JSX related rules.
|
|
563
|
+
*
|
|
564
|
+
* Currently only stylistic rules are included.
|
|
565
|
+
*
|
|
566
|
+
* @defaultValue true
|
|
567
|
+
*/
|
|
568
|
+
jsx?: boolean;
|
|
569
|
+
/**
|
|
570
|
+
* Options for eslint-plugin-unicorn.
|
|
571
|
+
*
|
|
572
|
+
* @defaultValue true
|
|
573
|
+
*/
|
|
574
|
+
unicorn?: boolean | OptionsUnicorn;
|
|
575
|
+
/**
|
|
576
|
+
* Options for eslint-plugin-jsdoc.
|
|
577
|
+
*
|
|
578
|
+
* @defaultValue false
|
|
579
|
+
*/
|
|
580
|
+
jsdoc?: boolean | OptionsJSDoc;
|
|
581
|
+
/**
|
|
582
|
+
* Options for @storm-software/eslint-plugin-tsdoc.
|
|
583
|
+
*
|
|
584
|
+
* @defaultValue true
|
|
585
|
+
*/
|
|
586
|
+
tsdoc?: boolean | OptionsTSDoc;
|
|
587
|
+
/**
|
|
588
|
+
* Enable Zod support.
|
|
589
|
+
*
|
|
590
|
+
* @defaultValue false
|
|
591
|
+
*/
|
|
592
|
+
zod?: boolean | OptionsOverrides;
|
|
593
|
+
/**
|
|
594
|
+
* Enable test support.
|
|
595
|
+
*
|
|
596
|
+
* @defaultValue true
|
|
597
|
+
*/
|
|
598
|
+
test?: boolean | OptionsOverrides;
|
|
599
|
+
/**
|
|
600
|
+
* Enable JSONC support.
|
|
601
|
+
*
|
|
602
|
+
* @defaultValue true
|
|
603
|
+
*/
|
|
604
|
+
jsonc?: boolean | OptionsOverrides;
|
|
605
|
+
/**
|
|
606
|
+
* Enable YAML support.
|
|
607
|
+
*
|
|
608
|
+
* @defaultValue true
|
|
609
|
+
*/
|
|
610
|
+
yaml?: boolean | OptionsOverrides;
|
|
611
|
+
/**
|
|
612
|
+
* Enable TOML support.
|
|
613
|
+
*
|
|
614
|
+
* @defaultValue true
|
|
615
|
+
*/
|
|
616
|
+
toml?: boolean | OptionsOverrides;
|
|
617
|
+
/**
|
|
618
|
+
* Enable ASTRO support.
|
|
619
|
+
*
|
|
620
|
+
* Requires installing:
|
|
621
|
+
* - `eslint-plugin-astro`
|
|
622
|
+
*
|
|
623
|
+
* Requires installing for formatting .astro:
|
|
624
|
+
* - `prettier-plugin-astro`
|
|
625
|
+
*
|
|
626
|
+
* @defaultValue false
|
|
627
|
+
*/
|
|
628
|
+
astro?: boolean | OptionsOverrides;
|
|
629
|
+
/**
|
|
630
|
+
* Enable linting for **code snippets** in Markdown.
|
|
631
|
+
*
|
|
632
|
+
* For formatting Markdown content, enable also `formatters.markdown`.
|
|
633
|
+
*
|
|
634
|
+
* @defaultValue false
|
|
635
|
+
*/
|
|
636
|
+
markdown?: boolean | OptionsOverrides;
|
|
637
|
+
/**
|
|
638
|
+
* Enable linting for mdx files.
|
|
639
|
+
*
|
|
640
|
+
* @defaultValue false
|
|
641
|
+
*/
|
|
642
|
+
mdx?: boolean | OptionsOverrides;
|
|
643
|
+
/**
|
|
644
|
+
* Enable stylistic rules.
|
|
645
|
+
*
|
|
646
|
+
* @see https://eslint.style/
|
|
647
|
+
*
|
|
648
|
+
* @defaultValue false
|
|
649
|
+
*/
|
|
650
|
+
stylistic?: boolean | (StylisticConfig & OptionsOverrides);
|
|
651
|
+
/**
|
|
652
|
+
* Enable regexp rules.
|
|
653
|
+
*
|
|
654
|
+
* @see https://ota-meshi.github.io/eslint-plugin-regexp/
|
|
655
|
+
* @defaultValue true
|
|
656
|
+
*/
|
|
657
|
+
regexp?: boolean | (OptionsRegExp & OptionsOverrides);
|
|
658
|
+
/**
|
|
659
|
+
* Enable GraphQL support.
|
|
660
|
+
*
|
|
661
|
+
* @defaultValue false
|
|
662
|
+
*/
|
|
663
|
+
graphql?: boolean | OptionsGraphQL;
|
|
664
|
+
/**
|
|
665
|
+
* Enable Storybook support.
|
|
666
|
+
*
|
|
667
|
+
* @defaultValue false
|
|
668
|
+
*/
|
|
669
|
+
storybook?: boolean | OptionsStorybook;
|
|
670
|
+
/**
|
|
671
|
+
* Enable react rules.
|
|
672
|
+
*
|
|
673
|
+
* Requires installing:
|
|
674
|
+
* - `@eslint-react/eslint-plugin`
|
|
675
|
+
* - `eslint-plugin-react-hooks`
|
|
676
|
+
* - `eslint-plugin-react-refresh`
|
|
677
|
+
*
|
|
678
|
+
* @defaultValue false
|
|
679
|
+
*/
|
|
680
|
+
react?: boolean | OptionsReact;
|
|
681
|
+
/**
|
|
682
|
+
* Enable react native rules.
|
|
683
|
+
*
|
|
684
|
+
* Requires installing:
|
|
685
|
+
* - `eslint-plugin-react-native`
|
|
686
|
+
*
|
|
687
|
+
* @defaultValue false
|
|
688
|
+
*/
|
|
689
|
+
"react-native"?: boolean | OptionsOverrides;
|
|
690
|
+
/**
|
|
691
|
+
* Enable next rules.
|
|
692
|
+
*
|
|
693
|
+
* Requires installing:
|
|
694
|
+
* - `@next/eslint-plugin-next`
|
|
695
|
+
*
|
|
696
|
+
* @defaultValue false
|
|
697
|
+
*/
|
|
698
|
+
next?: boolean | OptionsNext;
|
|
699
|
+
/**
|
|
700
|
+
* Enable unocss rules.
|
|
701
|
+
*
|
|
702
|
+
* Requires installing:
|
|
703
|
+
* - `@unocss/eslint-plugin`
|
|
704
|
+
*
|
|
705
|
+
* @defaultValue false
|
|
706
|
+
*/
|
|
707
|
+
unocss?: boolean | OptionsUnoCSS;
|
|
708
|
+
/**
|
|
709
|
+
* Use external formatters to format files.
|
|
710
|
+
*
|
|
711
|
+
* Requires installing:
|
|
712
|
+
* - `eslint-plugin-format`
|
|
713
|
+
*
|
|
714
|
+
* When set to `true`, it will enable all formatters.
|
|
715
|
+
*
|
|
716
|
+
* @defaultValue false
|
|
717
|
+
*/
|
|
718
|
+
formatters?: boolean | OptionsFormatters;
|
|
719
|
+
/**
|
|
720
|
+
* Control to disable some rules in editors.
|
|
721
|
+
* @defaultValue auto-detect based on the process.env
|
|
722
|
+
*/
|
|
723
|
+
isInEditor?: boolean;
|
|
724
|
+
/**
|
|
725
|
+
* Automatically rename plugins in the config.
|
|
726
|
+
*
|
|
727
|
+
* @defaultValue true
|
|
728
|
+
*/
|
|
729
|
+
autoRenamePlugins?: boolean;
|
|
730
|
+
}
|
|
731
|
+
type UserConfig = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<object, string> | Linter.Config[]>;
|
|
732
|
+
type PresetConfig<TOptions> = TOptions & Omit<TypedFlatConfigItem, "files">;
|
|
733
|
+
type PresetResult = FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
734
|
+
//#endregion
|
|
735
|
+
export { Awaitable, ConfigNames, ESLintGlobalsPropValue, OptionsBanner, OptionsBun, OptionsCSpell, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsGraphQL, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSDoc, OptionsJavascript, OptionsNext, OptionsNx, OptionsNxDependencyChecks, OptionsNxEnforceModuleBoundaries, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStorybook, OptionsStylistic, OptionsTSDoc, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, PresetConfig, PresetResult, RuleOptions, Rules, StylisticConfig, TypedFlatConfigItem, UserConfig };
|