@jsse/eslint-config 0.9.2 → 0.9.4

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.
@@ -0,0 +1,487 @@
1
+ import { A as E18eRules, C as JsoncRules, M as CommandRules, N as BuiltinRules, O as EslintReactRules, P as AntfuRules, S as MarkdownRules, T as JavascriptRules, _ as PnpmRules, a as VitestRules, c as TypescriptRules, h as ReactHooksRules, i as YmlRules, j as DeMorganRules, m as ReactRefreshRules, o as UnusedImportsRules, s as UnicornRules, t as AllRules, u as StylisticRules, w as JsdocRules, x as NRules, y as NodeTestRules } from "./rule-types-BuPkMYJJ.js";
2
+ import { ParserOptions } from "@typescript-eslint/parser";
3
+ import { Linter } from "eslint";
4
+ //#region node_modules/.pnpm/eslint-config-flat-gitignore@2.3.0_eslint@10.6.0_jiti@2.7.0_/node_modules/eslint-config-flat-gitignore/dist/index.d.mts
5
+ interface FlatGitignoreOptions {
6
+ /**
7
+ * Name of the configuration.
8
+ * @default 'gitignore'
9
+ */
10
+ name?: string;
11
+ /**
12
+ * Path to `.gitignore` files, or files with compatible formats like `.eslintignore`.
13
+ * @default ['.gitignore'] // or findUpSync('.gitignore')
14
+ */
15
+ files?: string | string[];
16
+ /**
17
+ * Path to `.gitmodules` file.
18
+ * @default ['.gitmodules'] // or findUpSync('.gitmodules')
19
+ */
20
+ filesGitModules?: string | string[];
21
+ /**
22
+ * Throw an error if gitignore file not found.
23
+ * @default true
24
+ */
25
+ strict?: boolean;
26
+ /**
27
+ * Mark the current working directory as the root directory,
28
+ * disable searching for `.gitignore` files in parent directories.
29
+ *
30
+ * This option is not effective when `files` is explicitly specified.
31
+ * @default false
32
+ */
33
+ root?: boolean;
34
+ /**
35
+ * Current working directory.
36
+ * Used to resolve relative paths.
37
+ * @default process.cwd()
38
+ */
39
+ cwd?: string;
40
+ /**
41
+ * Also include recursive `.gitignore` files under `cwd`.
42
+ *
43
+ * This option is useful for monorepos or projects that keep
44
+ * per-folder `.gitignore` files.
45
+ *
46
+ * Pass `{ skipDirs: ['name'] }` to skip directory names while
47
+ * scanning recursively. `skipDirs` matches by directory name at
48
+ * any depth (not by path), and is applied in addition to `.git`
49
+ * and `node_modules`.
50
+ * @default false
51
+ */
52
+ recursive?: boolean | {
53
+ skipDirs: string[];
54
+ };
55
+ }
56
+ //#endregion
57
+ //#region src/types.d.ts
58
+ type RulesRecord = Linter.RulesRecord & AllRules;
59
+ type Config = Omit<Linter.Config<Linter.RulesRecord & AllRules>, "plugins"> & {
60
+ /**
61
+ * 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.
62
+ * @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
63
+ */
64
+ plugins?: Record<string, any>;
65
+ };
66
+ type TypescriptConfigRules = TypescriptRules & BuiltinRules;
67
+ type Awaitable<T> = T | Promise<T>;
68
+ type RuleName = keyof AllRules;
69
+ type TypedFlatConfigItemWithId = Config & {
70
+ name: string;
71
+ };
72
+ type OptionsComponentExts = {
73
+ /**
74
+ * Additional extensions for components.
75
+ * @example ['vue']
76
+ * @default []
77
+ */
78
+ componentExts?: string[];
79
+ };
80
+ type EslintConfigFnAsync<T = undefined> = (options?: T) => Promise<TypedFlatConfigItemWithId[]>;
81
+ type EslintConfigFnSync<T = undefined> = (options?: T) => TypedFlatConfigItemWithId[];
82
+ type EslintConfigFn<T = undefined> = EslintConfigFnAsync<T> | EslintConfigFnSync<T>;
83
+ type OptionsFiles = {
84
+ /**
85
+ * Override the `files` option to provide custom globs.
86
+ */
87
+ files?: string[];
88
+ };
89
+ type OptionsTypeScriptParserOptions = {
90
+ /**
91
+ * Additional parser options for TypeScript.
92
+ */
93
+ parserOptions?: Partial<ParserOptions>;
94
+ /**
95
+ * Flag to use `projectService` for type-aware linting.
96
+ *
97
+ * If `true` use fancy new `projectService` for type-aware linting.
98
+ * If `false` use classic `project` configuration.
99
+ *
100
+ * When omitted, this is auto-detected: `projectService` is used only
101
+ * when `tsconfig` is exactly `"tsconfig.json"` (or `["tsconfig.json"]`);
102
+ * any other `tsconfig` value falls back to classic `project` mode.
103
+ * @default auto-detected from `tsconfig`
104
+ */
105
+ useProjectService?: boolean;
106
+ /**
107
+ * Glob patterns for files that should be type aware.
108
+ * @default ['**\/*.{ts,tsx}']
109
+ */
110
+ filesTypeAware?: string[];
111
+ /**
112
+ * Glob patterns for files that should not be type aware.
113
+ * @default ['**\/*.md\/**']
114
+ */
115
+ ignoresTypeAware?: string[];
116
+ };
117
+ type TypescriptPreset = "all" | "base" | "disable-type-checked" | "eslint-recommended" | "recommended" | "recommended-type-checked" | "recommended-type-checked-only" | "strict" | "strict-type-checked" | "strict-type-checked-only" | "stylistic" | "stylistic-type-checked" | "stylistic-type-checked-only";
118
+ type OptionsTypeScriptWithTypes = {
119
+ /**
120
+ * When this options is provided, type aware rules will be enabled.
121
+ * @see https://typescript-eslint.io/linting/typed-linting/
122
+ */
123
+ tsconfig?: string | string[];
124
+ /**
125
+ * Override only type-aware rules.
126
+ */
127
+ overridesTypeAware?: Config["rules"];
128
+ /**
129
+ * Override TypeScript rules.
130
+ */
131
+ overrides?: TypescriptConfigRules;
132
+ /**
133
+ * TypeScript ESLint preset or presets to use as the base ruleset.
134
+ *
135
+ * Preset names match the kebab-case TypeScript ESLint config names.
136
+ * @default "recommended-type-checked" when type-aware, otherwise "recommended"
137
+ */
138
+ presets?: TypescriptPreset | TypescriptPreset[];
139
+ /**
140
+ * strict vs recommended configs, cannot be used with presets
141
+ * @default false
142
+ */
143
+ strict?: boolean;
144
+ /**
145
+ * typeAware
146
+ */
147
+ typeAware?: boolean;
148
+ };
149
+ type OptionsTypescript = OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & {
150
+ typedefs?: "type" | "interface";
151
+ };
152
+ type OptionsStylistic = {
153
+ stylistic?: boolean | StylisticConfig;
154
+ };
155
+ type StylisticConfig = {
156
+ indent?: number | "tab";
157
+ quotes?: "single" | "double";
158
+ jsx?: boolean;
159
+ overrides?: StylisticRules;
160
+ };
161
+ type OptionsIsInEditor = {
162
+ isInEditor?: boolean;
163
+ };
164
+ type OptionsAntfu = {
165
+ topLevelFunction?: "error" | "off";
166
+ overrides?: AntfuRules;
167
+ };
168
+ type OptionsCommand = {
169
+ overrides?: CommandRules;
170
+ };
171
+ type OptionsDeMorgan = {
172
+ overrides?: DeMorganRules;
173
+ };
174
+ type OptionsE18e = {
175
+ modernization?: boolean;
176
+ moduleReplacements?: boolean;
177
+ performanceImprovements?: boolean;
178
+ overrides?: E18eRules;
179
+ };
180
+ type OptionsJavascript = {
181
+ overrides?: JavascriptRules;
182
+ };
183
+ type OptionsJsdoc = {
184
+ overrides?: JsdocRules;
185
+ };
186
+ type OptionsJsonc = OptionsStylistic & {
187
+ overrides?: JsoncRules;
188
+ };
189
+ type OptionsMarkdown = OptionsComponentExts & {
190
+ overrides?: MarkdownRules;
191
+ };
192
+ type OptionsN = {
193
+ overrides?: NRules;
194
+ };
195
+ type OptionsNodeTest = {
196
+ /**
197
+ * Files to include for node-test rules.
198
+ *
199
+ * Defaults to `GLOB_TESTS`
200
+ */
201
+ files?: string[];
202
+ /**
203
+ * eslint-node-test preset to use as the base ruleset.
204
+ * @default "recommended"
205
+ */
206
+ preset?: "recommended" | "unopinionated" | "all";
207
+ /**
208
+ * Override eslint-node-test rules after applying the preset.
209
+ */
210
+ overrides?: NodeTestRules;
211
+ };
212
+ type OptionsPnpm = {
213
+ overrides?: PnpmRules;
214
+ };
215
+ type ReactHooksPreset = "recommended" | "recommended-latest";
216
+ type ReactPreset = "recommended" | "recommended-type-checked" | "recommended-typescript" | "strict" | "strict-type-checked" | "strict-typescript";
217
+ type OptionsReactConfig = {
218
+ /**
219
+ * Enable eslint-plugin-react-hooks rules or select its preset.
220
+ * @default "recommended"
221
+ */
222
+ hooks?: boolean | ReactHooksPreset;
223
+ /**
224
+ * Enable eslint-plugin-react-refresh rules.
225
+ * @default true
226
+ */
227
+ refresh?: boolean;
228
+ /**
229
+ * Use `refresh` instead.
230
+ * @deprecated
231
+ */
232
+ reactRefresh?: boolean;
233
+ overrides?: EslintReactRules & ReactHooksRules & ReactRefreshRules;
234
+ /**
235
+ * `@eslint-react/eslint-plugin` preset to use as the base ruleset.
236
+ *
237
+ * Preset names match the kebab-case `@eslint-react` config names.
238
+ * @default "recommended"
239
+ */
240
+ preset?: ReactPreset;
241
+ };
242
+ type OptionsSortTsconfig = {
243
+ extendTsconfigGlobs?: string[];
244
+ };
245
+ type OptionsUnicorn = {
246
+ /**
247
+ * Unicorn preset to use as the base ruleset.
248
+ * @default "recommended"
249
+ */
250
+ preset?: "recommended" | "unopinionated" | "all";
251
+ /**
252
+ * Override Unicorn rules after applying the preset and built-in rules.
253
+ */
254
+ overrides?: UnicornRules;
255
+ };
256
+ type OptionsUnusedImports = OptionsIsInEditor & {
257
+ /**
258
+ * Override eslint-plugin-unused-imports rules after applying built-in rules.
259
+ */
260
+ overrides?: UnusedImportsRules;
261
+ };
262
+ type OptionsVitest = {
263
+ overrides?: VitestRules;
264
+ };
265
+ type OptionsYaml = OptionsFiles & OptionsStylistic & {
266
+ overrides?: YmlRules;
267
+ };
268
+ type OptionsConfigs = {
269
+ /**
270
+ * Enable eslint-plugin-antfu.
271
+ * @default true
272
+ */
273
+ antfu?: boolean | OptionsAntfu;
274
+ /**
275
+ * Enable `eslint-plugin-command`
276
+ * @default true
277
+ */
278
+ command?: boolean | OptionsCommand;
279
+ /**
280
+ * Enable eslint-plugin-de-morgan.
281
+ * @default true
282
+ */
283
+ demorgan?: boolean | OptionsDeMorgan;
284
+ /**
285
+ * Enable @e18e/eslint-plugin.
286
+ * @default true
287
+ */
288
+ e18e?: boolean | OptionsE18e;
289
+ /**
290
+ * Configure JavaScript rules.
291
+ */
292
+ javascript?: OptionsJavascript;
293
+ /**
294
+ * Enable eslint-plugin-jsdoc.
295
+ * @default true
296
+ */
297
+ jsdoc?: boolean | OptionsJsdoc;
298
+ /**
299
+ * Enable eslint-plugin-n (Node.js rules).
300
+ * @default true
301
+ */
302
+ n?: boolean | OptionsN;
303
+ /**
304
+ * Enable `eslint-node-test` (Node.js built-in test runner rules).
305
+ * @default false
306
+ */
307
+ nodeTest?: boolean | OptionsNodeTest;
308
+ /**
309
+ * Enable eslint-plugin-pnpm.
310
+ * @default false
311
+ */
312
+ pnpm?: boolean | OptionsPnpm;
313
+ /**
314
+ * Enable TypeScript support.
315
+ *
316
+ * Passing an object to enable TypeScript Language Server support.
317
+ * @default auto-detect based on the dependencies
318
+ */
319
+ typescript?: boolean | OptionsTypescript;
320
+ /**
321
+ * Enable eslint-plugin-unicorn.
322
+ * @default true
323
+ */
324
+ unicorn?: boolean | OptionsUnicorn;
325
+ /**
326
+ * Enable eslint-plugin-unused-imports.
327
+ * @default true
328
+ */
329
+ unusedImports?: boolean | OptionsUnusedImports;
330
+ react?: boolean | OptionsReactConfig;
331
+ /**
332
+ * Enable regexp plugin
333
+ * @default true
334
+ */
335
+ regexp?: boolean;
336
+ /**
337
+ * Enable `@vitest/eslint-plugin` (Vitest rules).
338
+ * @default auto-detect based on the dependencies
339
+ */
340
+ vitest?: boolean | OptionsVitest;
341
+ /**
342
+ * Enable JSONC support.
343
+ * @default true
344
+ */
345
+ jsonc?: boolean | OptionsJsonc;
346
+ /**
347
+ * Enable YAML support.
348
+ * @default false
349
+ */
350
+ yaml?: boolean | OptionsYaml;
351
+ /**
352
+ * Enable Markdown support.
353
+ * @default false
354
+ */
355
+ markdown?: boolean | OptionsMarkdown;
356
+ /**
357
+ * Enable stylistic rules.
358
+ * @default true
359
+ */
360
+ stylistic?: boolean | StylisticConfig;
361
+ };
362
+ /**
363
+ * Deprecated options that are still supported
364
+ */
365
+ type OptionsDeprecated = {
366
+ /**
367
+ * Enable `eslint-plugin-react-refresh` rules.
368
+ * @default true
369
+ * @deprecated use `react.refresh` instead
370
+ */
371
+ reactRefresh?: boolean;
372
+ /**
373
+ * Enable Tailwind CSS support.
374
+ *
375
+ * Passing an object to configure the options.
376
+ * Tailwind support is currently disabled; passing this option only logs a warning.
377
+ * @deprecated deprecated tw support
378
+ * @default false
379
+ */
380
+ tailwind?: boolean | {
381
+ overrides?: Record<string, unknown>;
382
+ };
383
+ };
384
+ type OptionsConfig = OptionsComponentExts & OptionsTypeScriptParserOptions & OptionsConfigs & OptionsDeprecated & {
385
+ /**
386
+ * Enable debug mode.
387
+ */
388
+ debug?: boolean;
389
+ /**
390
+ * Enable configuration diagnostics.
391
+ * @default true
392
+ */
393
+ diagnostics?: boolean;
394
+ /**
395
+ * Enable reporting of unused disable directives.
396
+ * @default true
397
+ */
398
+ reportUnusedDisableDirectives?: boolean;
399
+ /**
400
+ * Array of rules to turn off.
401
+ */
402
+ off?: RuleName[] | Set<RuleName>;
403
+ /**
404
+ * Enable fast mode.
405
+ *
406
+ * This will disable some rules to speed up linting.
407
+ */
408
+ fast?: boolean;
409
+ /**
410
+ * Enable Prettier config rules to disable conflicting ESLint rules
411
+ *
412
+ * THIS DOES NOT ENABLE PRETTIER FORMATTING. YOU DO THAT, BUT I
413
+ * RECOMMEND USING PRETTIER TO FORMAT AND NOT THE ESLint PRETTIER
414
+ * PLUGIN!.
415
+ */
416
+ prettier?: boolean;
417
+ /**
418
+ * The prefix for the name of the config item.
419
+ * @default "jsse"
420
+ */
421
+ rootId?: string;
422
+ /**
423
+ * Optional function to run before the final config is returned.
424
+ */
425
+ preReturn?: (configs: Config[]) => Config[] | Awaitable<Config[]>;
426
+ /**
427
+ * Enable gitignore support.
428
+ *
429
+ * Passing an object to configure the options.
430
+ * @see https://github.com/antfu/eslint-config-flat-gitignore
431
+ * @default true
432
+ */
433
+ gitignore?: boolean | FlatGitignoreOptions;
434
+ /**
435
+ * Enable sorting of package.json files.
436
+ * @default true
437
+ */
438
+ sortPackageJson?: boolean;
439
+ /**
440
+ * Enable sorting of tsconfig.json files.
441
+ * @default true
442
+ */
443
+ sortTsconfig?: boolean | OptionsSortTsconfig;
444
+ /**
445
+ * Enable sorting of geojson files.
446
+ * @default false
447
+ */
448
+ sortGeojson?: boolean;
449
+ /**
450
+ * Enable import/export sorting via perfectionist.
451
+ * @default false
452
+ */
453
+ sortImports?: boolean;
454
+ /**
455
+ * The prefix for the name of the config item
456
+ * @default "@typescript-eslint"
457
+ */
458
+ tsPrefix?: string;
459
+ /**
460
+ * Glob patterns for ADDITIONAL tsconfig files to lint (aka sort)
461
+ *
462
+ * Has nothing to do with `@typescript-eslint/parser` or `typescript-eslint/eslint-plugin`
463
+ * @default ['tsconfig.json', 'tsconfig.*.json']
464
+ */
465
+ extendTsconfigLintGlobs?: string[];
466
+ /**
467
+ * Forcibly disable type aware rules
468
+ */
469
+ typeAware?: boolean;
470
+ /**
471
+ * Enable JSX related rules.
472
+ *
473
+ * Currently only stylistic rules are included.
474
+ * @default true
475
+ */
476
+ jsx?: boolean;
477
+ /**
478
+ * Control to disable some rules in editors.
479
+ * @default auto-detect based on the process.env
480
+ */
481
+ isInEditor?: boolean;
482
+ };
483
+ //#endregion
484
+ //#region src/_generated/fixable-rules-map.d.ts
485
+ declare const FIXABLE_RULES_MAP: Record<string, RuleName[]>;
486
+ //#endregion
487
+ export { OptionsConfig as a, RuleName as c, TypescriptPreset as d, EslintConfigFn as i, RulesRecord as l, Awaitable as n, ReactHooksPreset as o, Config as r, ReactPreset as s, FIXABLE_RULES_MAP as t, TypedFlatConfigItemWithId as u };