@jsse/eslint-config 0.9.1 → 0.9.3

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