@fabdeh/eslint-config 0.1.2 → 0.2.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.
package/dist/index.d.ts DELETED
@@ -1,782 +0,0 @@
1
- import { ConfigArray, ConfigWithExtends } from 'typescript-eslint';
2
- import { StylisticCustomizeOptions } from '@stylistic/eslint-plugin';
3
- import { TSESLint } from '@typescript-eslint/utils';
4
- import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
5
-
6
- /**
7
- * Vendor types from Prettier so we don't rely on the dependency.
8
- */
9
- type VendoredPrettierOptions = Partial<VendoredPrettierOptionsRequired>;
10
- interface VendoredPrettierOptionsRequired {
11
- /**
12
- * Specify the line length that the printer will wrap on.
13
- *
14
- * @default 120
15
- */
16
- printWidth: number;
17
- /**
18
- * Specify the number of spaces per indentation-level.
19
- */
20
- tabWidth: number;
21
- /**
22
- * Indent lines with tabs instead of spaces
23
- */
24
- useTabs?: boolean;
25
- /**
26
- * Print semicolons at the ends of statements.
27
- */
28
- semi: boolean;
29
- /**
30
- * Use single quotes instead of double quotes.
31
- */
32
- singleQuote: boolean;
33
- /**
34
- * Use single quotes in JSX.
35
- */
36
- jsxSingleQuote: boolean;
37
- /**
38
- * Print trailing commas wherever possible.
39
- */
40
- trailingComma: 'all' | 'es5' | 'none';
41
- /**
42
- * Print spaces between brackets in object literals.
43
- */
44
- bracketSpacing: boolean;
45
- /**
46
- * Put the `>` of a multi-line HTML (HTML, XML, JSX, Vue, Angular) element at the end of the last line instead of being
47
- * alone on the next line (does not apply to self closing elements).
48
- */
49
- bracketSameLine: boolean;
50
- /**
51
- * Put the `>` of a multi-line JSX element at the end of the last line instead of being alone on the next line.
52
- *
53
- * @deprecated use bracketSameLine instead
54
- */
55
- jsxBracketSameLine: boolean;
56
- /**
57
- * Format only a segment of a file.
58
- */
59
- rangeStart: number;
60
- /**
61
- * Format only a segment of a file.
62
- *
63
- * @default Number.POSITIVE_INFINITY
64
- */
65
- rangeEnd: number;
66
- /**
67
- * By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer.
68
- * In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out.
69
- *
70
- * @default "preserve"
71
- */
72
- proseWrap: 'always' | 'never' | 'preserve';
73
- /**
74
- * Include parentheses around a sole arrow function parameter.
75
- *
76
- * @default "always"
77
- */
78
- arrowParens: 'always' | 'avoid';
79
- /**
80
- * Provide ability to support new languages to prettier.
81
- */
82
- plugins: (any | string)[];
83
- /**
84
- * How to handle whitespaces in HTML.
85
- *
86
- * @default "css"
87
- */
88
- htmlWhitespaceSensitivity: 'css' | 'ignore' | 'strict';
89
- /**
90
- * Which end of line characters to apply.
91
- *
92
- * @default "lf"
93
- */
94
- endOfLine: 'auto' | 'cr' | 'crlf' | 'lf';
95
- /**
96
- * Change when properties in objects are quoted.
97
- *
98
- * @default "as-needed"
99
- */
100
- quoteProps: 'as-needed' | 'consistent' | 'preserve';
101
- /**
102
- * Whether or not to indent the code inside <script> and <style> tags in Vue files.
103
- *
104
- * @default false
105
- */
106
- vueIndentScriptAndStyle: boolean;
107
- /**
108
- * Enforce single attribute per line in HTML, XML, Vue and JSX.
109
- *
110
- * @default false
111
- */
112
- singleAttributePerLine: boolean;
113
- /**
114
- * How to handle whitespaces in XML.
115
- *
116
- * @default "preserve"
117
- */
118
- xmlQuoteAttributes: 'double' | 'preserve' | 'single';
119
- /**
120
- * Whether to put a space inside the brackets of self-closing XML elements.
121
- *
122
- * @default true
123
- */
124
- xmlSelfClosingSpace: boolean;
125
- /**
126
- * Whether to sort attributes by key in XML elements.
127
- *
128
- * @default false
129
- */
130
- xmlSortAttributesByKey: boolean;
131
- /**
132
- * How to handle whitespaces in XML.
133
- *
134
- * @default "ignore"
135
- */
136
- xmlWhitespaceSensitivity: 'ignore' | 'preserve' | 'strict';
137
- }
138
-
139
- /**
140
- * A type that can be awaited. Promise<T> or T.
141
- */
142
- type Awaitable<T> = Promise<T> | T;
143
- /**
144
- * Options for determining if the code is running in an editor environment.
145
- */
146
- interface IsInEditorOptions {
147
- /**
148
- * Optional property that allows specifying if the code is running in an editor environment.
149
- */
150
- isInEditor?: boolean;
151
- }
152
- /**
153
- * Interface representing options for overriding default ESLint rules.
154
- */
155
- interface OverridesOptions {
156
- /**
157
- * Optional property that allows specifying custom rules to override the default ones.
158
- */
159
- overrides?: TSESLint.FlatConfig.Config['rules'];
160
- }
161
- /**
162
- * Options for specifying files.
163
- */
164
- interface FilesOptions {
165
- /**
166
- * Override the `files` option to provide custom globs.
167
- */
168
- files?: string[];
169
- }
170
- /**
171
- * Options for configuring the behavior of the Unicorn config.
172
- */
173
- interface UnicornOptions {
174
- /**
175
- * If set to `true`, enables all recommended settings from unicorn plugin.
176
- *
177
- * @default false
178
- */
179
- allRecommended?: boolean;
180
- }
181
- /**
182
- * An alias for the `StylisticCustomizeOptions` type without the `flat`, `name`, and `pluginName` properties.
183
- */
184
- type StylisticConfig = Omit<StylisticCustomizeOptions, 'flat' | 'name' | 'pluginName'>;
185
- /**
186
- * Interface representing the stylistic options.
187
- */
188
- interface StylisticOptions {
189
- /**
190
- * Optional property that allows specifying stylistic options.
191
- */
192
- stylistic?: StylisticConfig | boolean;
193
- }
194
- /**
195
- * Options for configuring the TypeScript parser.
196
- */
197
- interface TypeScriptParserOptions {
198
- /**
199
- * Optional parser options to be used by the TypeScript parser.
200
- */
201
- parserOptions?: TSESLint.FlatConfig.ParserOptions;
202
- }
203
- /**
204
- * Options for configuring Angular-specific linting rules.
205
- */
206
- interface AngularOptions {
207
- /**
208
- * Whether to enable accessibility rules.
209
- *
210
- * @default true
211
- */
212
- enableAccessibilityRules?: boolean;
213
- /**
214
- * Prefix to use for Angular components, directives, and pipes.
215
- * Can be a single string or an array of strings.
216
- *
217
- * @default 'app'
218
- */
219
- prefix?: string[] | string;
220
- /**
221
- * TypeScript-specific linting rule overrides.
222
- */
223
- tsOverrides?: TSESLint.FlatConfig.Config['rules'];
224
- /**
225
- * HTML-specific linting rule overrides.
226
- */
227
- htmlOverrides?: TSESLint.FlatConfig.Config['rules'];
228
- }
229
- /**
230
- * Interface representing configuration options for enforcing NgRx operators rules.
231
- */
232
- interface NgrxOperators {
233
- /**
234
- * Whether to enforce NgRx operators rules.
235
- *
236
- * @default true
237
- */
238
- enforceOperatorsRules?: boolean;
239
- }
240
- /**
241
- * Configuration options for NGRX.
242
- */
243
- interface NgrxOptions {
244
- /**
245
- * Configuration for the NGRX store.
246
- *
247
- * If set to `true`, the default configuration will be used.
248
- * If set to an object, it should contain options for files, NGRX operators, and overrides.
249
- */
250
- store?: boolean | (FilesOptions & NgrxOperators & OverridesOptions);
251
- /**
252
- * Configuration for NGRX effects.
253
- *
254
- * If set to `true`, the default configuration will be used.
255
- * If set to an object, it should contain options for files, NGRX operators, and overrides.
256
- */
257
- effects?: boolean | (FilesOptions & NgrxOperators & OverridesOptions);
258
- /**
259
- * Configuration for NGRX signals.
260
- *
261
- * If set to `true`, the default configuration will be used.
262
- * If set to an object, it should contain options for files, NGRX operators, and overrides.
263
- */
264
- signals?: boolean | (FilesOptions & NgrxOperators & OverridesOptions);
265
- }
266
- /**
267
- * Options for configuring testing utilities.
268
- */
269
- interface TestingOptions {
270
- /**
271
- * Indicates whether to include Jest DOM matchers.
272
- *
273
- * @default auto-detect based on the dependencies.
274
- */
275
- useJestDom?: boolean;
276
- /**
277
- * Indicates whether to include Testing Library utilities.
278
- *
279
- * @default auto-detect based on the dependencies.
280
- */
281
- useTestingLibrary?: boolean;
282
- }
283
- interface FormattersOptions {
284
- css?: boolean;
285
- html?: boolean;
286
- xml?: boolean;
287
- svg?: boolean;
288
- markdown?: boolean;
289
- graphql?: boolean;
290
- options?: VendoredPrettierOptions;
291
- slidev?: boolean | {
292
- files?: string[];
293
- };
294
- }
295
- /**
296
- * Options for creating an ESLint configuration.
297
- *
298
- * @see createConfig function
299
- */
300
- interface CreateConfigOptions {
301
- /**
302
- * Enable gitignore support.
303
- *
304
- * Passing an object to configure the options.
305
- *
306
- * @see https://github.com/antfu/eslint-config-flat-gitignore
307
- * @default true
308
- */
309
- gitignore?: FlatGitignoreOptions | boolean;
310
- /**
311
- * JavaScript rules overrides. Can't be disabled.
312
- */
313
- javascript?: OverridesOptions;
314
- /**
315
- * TypeScript rules overrides and parser configuration.
316
- *
317
- * @default auto-detected
318
- */
319
- typescript?: OverridesOptions & TypeScriptParserOptions;
320
- /**
321
- * Enable stylistic rules.
322
- *
323
- * @see https://eslint.style/
324
- * @default true
325
- */
326
- stylistic?: boolean | (OverridesOptions & StylisticConfig);
327
- /**
328
- * Options for eslint-plugin-unicorn.
329
- *
330
- * @default true
331
- */
332
- unicorn?: UnicornOptions | boolean;
333
- /**
334
- * Options for the angular linting rules
335
- *
336
- * @default auto-detect based on the dependencies.
337
- */
338
- angular?: AngularOptions | boolean;
339
- /**
340
- * Options for the ngrx linting rules.
341
- *
342
- * @default auto-detect based on dependencies.
343
- */
344
- ngrx?: NgrxOptions | boolean;
345
- /**
346
- * Options for the jest linting rules. This option is mutually exclusive with vitest.
347
- *
348
- * @default auto-detect based on dependencies.
349
- */
350
- jest?: boolean | (OverridesOptions & TestingOptions);
351
- /**
352
- * Options for the vitest linting rules. This option is mutually exclusive with jest.
353
- *
354
- * @default auto-detect based on dependencies.
355
- */
356
- vitest?: boolean | (OverridesOptions & TestingOptions);
357
- /**
358
- * Options for the TailwindCSS linting rules.
359
- *
360
- * @default auto-detect based on dependencies.
361
- */
362
- tailwindcss?: OverridesOptions | boolean;
363
- /**
364
- * Enable JSONC support.
365
- *
366
- * @default true
367
- */
368
- jsonc?: OverridesOptions | boolean;
369
- /**
370
- * Enable YAML support.
371
- *
372
- * @default true
373
- */
374
- yaml?: OverridesOptions | boolean;
375
- /**
376
- * Enable TOML support.
377
- *
378
- * @default true
379
- */
380
- toml?: OverridesOptions | boolean;
381
- /**
382
- * Enable linting for **code snippets** in Markdown.
383
- *
384
- * For formatting Markdown content, enable also `formatters.markdown`.
385
- *
386
- * @default true
387
- */
388
- markdown?: OverridesOptions | boolean;
389
- /**
390
- * Use external formatters to format files.
391
- *
392
- * Requires installing:
393
- * - `eslint-plugin-format`
394
- *
395
- * When set to `true`, it will enable all formatters.
396
- *
397
- * @default false
398
- */
399
- formatters?: FormattersOptions | boolean;
400
- /**
401
- * Control to disable some rules in editors.
402
- *
403
- * @default auto-detect based on the process.env
404
- */
405
- isInEditor?: boolean;
406
- }
407
-
408
- /**
409
- * Generates an ESLint configuration for Angular projects.
410
- *
411
- * @param options - Configuration options for Angular ESLint.
412
- * @param options.enableAccessibilityRules - Whether to enable accessibility rules for HTML templates.
413
- * @param options.tsOverrides - Additional TypeScript rule overrides.
414
- * @param options.htmlOverrides - Additional HTML rule overrides.
415
- * @param options.prefix - The prefix to use for Angular component and directive selectors.
416
- * @returns A promise that resolves to an array of ESLint configurations.
417
- */
418
- declare function angular(options?: AngularOptions): Promise<ConfigArray>;
419
-
420
- /**
421
- * Generates a configuration array for ESLint comments rules.
422
- *
423
- * This function returns a configuration array that includes rules for managing
424
- * ESLint comments in the codebase. It uses the `@eslint-community/eslint-comments`
425
- * plugin to enforce best practices and prevent common issues with ESLint comments.
426
- *
427
- * @returns The configuration array for ESLint comments rules.
428
- */
429
- declare function comments(): ConfigArray;
430
-
431
- /**
432
- * Generates a configuration array for ESLint with default and user-defined ignore patterns.
433
- *
434
- * @param userIgnores - An array of user-defined glob patterns to ignore. Defaults to an empty array.
435
- * @returns A ConfigArray object containing the combined ignore patterns.
436
- */
437
- declare function ignores(userIgnores?: string[]): ConfigArray;
438
-
439
- /**
440
- * Generates an ESLint configuration array for import rules.
441
- *
442
- * @param options - An object containing stylistic options.
443
- * @param options.stylistic - A boolean indicating whether to include stylistic rules. Defaults to true.
444
- * @returns A ConfigArray object with the specified import rules.
445
- */
446
- declare function imports(options?: StylisticOptions): ConfigArray;
447
-
448
- /**
449
- * Generates a configuration array for JavaScript projects with ESLint.
450
- *
451
- * This function sets up ESLint configurations for JavaScript projects, including language options,
452
- * linter options, and specific rules. It supports options for Angular decorators and unused imports
453
- * handling based on the environment (editor or not).
454
- *
455
- * @param options - Configuration options for the JavaScript setup.
456
- * @param options.isInEditor - Indicates if the configuration is being used in an editor.
457
- * @param options.overrides - Additional rule overrides.
458
- * @param options.allowAngularDecorator - Allows specific Angular decorators to be used without new-cap errors.
459
- * @returns A configuration array for ESLint.
460
- * @example
461
- * ```typescript
462
- * const config = javascript({ isInEditor: true, allowAngularDecorator: true });
463
- * ```
464
- */
465
- declare function javascript(options?: IsInEditorOptions & OverridesOptions & {
466
- allowAngularDecorator?: boolean;
467
- }): ConfigArray;
468
-
469
- /**
470
- * Generates an ESLint configuration for Jest testing environments.
471
- *
472
- * @param options - Configuration options for the Jest setup.
473
- * @param options.overrides - Custom rule overrides to apply.
474
- * @param options.useJestDom - Whether to include `@testing-library/jest-dom` plugin. Defaults to checking if the package exists.
475
- * @param options.useTestingLibrary - Whether to include `@testing-library/angular` plugin. Defaults to checking if the package exists.
476
- * @param options.stylistic - Whether to include stylistic rules. Defaults to `true`.
477
- * @returns A promise that resolves to a `ConfigArray` containing the ESLint configuration.
478
- */
479
- declare function jest(options?: OverridesOptions & StylisticOptions & TestingOptions): Promise<ConfigArray>;
480
-
481
- /**
482
- * Generates a configuration array for JSDoc rules.
483
- *
484
- * @param options - An object containing stylistic options.
485
- * @param options.stylistic - A boolean indicating whether to include stylistic rules. Defaults to true.
486
- * @returns A configuration array for JSDoc rules.
487
- */
488
- declare function jsdoc(options?: StylisticOptions): ConfigArray;
489
-
490
- /**
491
- * Generates an ESLint configuration for JSONC files.
492
- *
493
- * @param options - Configuration options for the JSONC setup.
494
- * @param options.files - An array of glob patterns to specify the JSONC files to lint. Defaults to `[GLOB_JSON, GLOB_JSON5, GLOB_JSONC]`.
495
- * @param options.overrides - Additional rules or configurations to override the default settings.
496
- * @param options.stylistic - A boolean or object to enable or configure stylistic rules. Defaults to `true`.
497
- * @returns A promise that resolves to a `ConfigArray` containing the ESLint configuration.
498
- * @example
499
- * ```typescript
500
- * const config = await jsonc({
501
- * files: ['**\/*.json'],
502
- * stylistic: {
503
- * indent: 4,
504
- * },
505
- * });
506
- * ```
507
- */
508
- declare function jsonc(options?: FilesOptions & OverridesOptions & StylisticOptions): Promise<ConfigArray>;
509
-
510
- /**
511
- * Configures ESLint for Markdown files.
512
- *
513
- * This function sets up ESLint configurations specifically for Markdown files,
514
- * including custom parsers, plugins, processors, and rule overrides.
515
- *
516
- * @param options - An object containing file and override options.
517
- * @param options.files - An array of glob patterns to specify the Markdown files to lint.
518
- * @param options.overrides - An object containing rule overrides.
519
- * @returns A promise that resolves to a ConfigArray containing the ESLint configurations.
520
- * @example
521
- * ```typescript
522
- * const config = await markdown({
523
- * files: ['**\/*.md'],
524
- * overrides: {
525
- * 'no-console': 'warn',
526
- * },
527
- * });
528
- * ```
529
- */
530
- declare function markdown(options?: FilesOptions & OverridesOptions): Promise<ConfigArray>;
531
-
532
- /**
533
- * Generates an ESLint configuration array for NgRx based on the provided options.
534
- *
535
- * @param [options] - The options to configure NgRx rules.
536
- * @param [options.store] - If true or an object, includes NgRx store rules.
537
- * @param [options.effects] - If true or an object, includes NgRx effects rules.
538
- * @param [options.signals] - If true or an object, includes NgRx signals rules.
539
- * @returns A promise that resolves to the ESLint configuration array.
540
- * @example
541
- * // Basic usage
542
- * const config = await ngrx();
543
- * @example
544
- * ```ts
545
- * // With custom options
546
- * const config = await ngrx({
547
- * store: { files: ['**\/*.store.ts'] },
548
- * effects: { files: ['**\/*.effects.ts'] },
549
- * signals: { files: ['**\/*.signals.ts'] }
550
- * });
551
- * ```
552
- */
553
- declare function ngrx(options?: NgrxOptions): Promise<ConfigArray>;
554
-
555
- /**
556
- * Generates a configuration array for the "perfectionist" ESLint plugin.
557
- *
558
- * This configuration includes rules for sorting various elements in the codebase
559
- * such as exports, imports, intersection types, named exports, named imports,
560
- * switch cases, and union types. The sorting order is set to ascending and the
561
- * type is natural.
562
- *
563
- * @returns The configuration array for the "perfectionist" plugin.
564
- */
565
- declare function perfectionist(): ConfigArray;
566
-
567
- /**
568
- * Configures ESLint rules for sorting keys and array values in `package.json` files.
569
- *
570
- * This function returns a configuration array that enforces specific sorting rules
571
- * for various sections of `package.json` files. The rules include:
572
- * - Sorting array values in ascending order for the `files` field.
573
- * - Sorting keys in a predefined order for the root level of `package.json`.
574
- * - Sorting dependency fields (`dependencies`, `devDependencies`, `peerDependencies`, etc.) in ascending order.
575
- * - Sorting specific fields within the `exports` section.
576
- * - Sorting client hooks in a predefined order for `gitHooks`, `husky`, and `simple-git-hooks`.
577
- *
578
- * @returns The ESLint configuration array with sorting rules.
579
- */
580
- declare function sortPackageJson(): ConfigArray;
581
- /**
582
- * Generates a TypeScript ESLint configuration array that enforces sorting rules for `tsconfig.json` files.
583
- *
584
- * The configuration includes rules to:
585
- * - Sort the top-level keys of `tsconfig.json` files in a specific order.
586
- * - Sort the keys within the `compilerOptions` section of `tsconfig.json` files in a specific order.
587
- *
588
- * @returns The TypeScript ESLint configuration array with sorting rules.
589
- */
590
- declare function sortTsConfig(): ConfigArray;
591
-
592
- declare const STYLISTIC_CONFIG_DEFAULT: StylisticConfig;
593
- /**
594
- * Generates a stylistic ESLint configuration.
595
- *
596
- * @param [options] - Optional configuration options to customize the stylistic rules.
597
- * @returns A promise that resolves to an array of ESLint configurations.
598
- * @example
599
- * const config = await stylistic({ semi: false });
600
- */
601
- declare function stylistic(options?: StylisticOptions): Promise<ConfigArray>;
602
-
603
- /**
604
- * Generates an ESLint configuration array for Tailwind CSS.
605
- *
606
- * @param [options] - Optional overrides for the configuration.
607
- * @returns A promise that resolves to the ESLint configuration array.
608
- * @example
609
- * const config = await tailwindcss({
610
- * overrides: {
611
- * 'tailwindcss/classnames-order': 'warn',
612
- * },
613
- * });
614
- */
615
- declare function tailwindcss(options?: OverridesOptions): Promise<ConfigArray>;
616
-
617
- /**
618
- * Generates an ESLint configuration for TOML files.
619
- *
620
- * @param options - The configuration options.
621
- * @param options.files - The glob patterns for the files to lint.
622
- * @param options.overrides - The rules to override the default configuration.
623
- * @param options.stylistic - Whether to apply stylistic rules or a configuration object for stylistic rules.
624
- * @param options.stylistic.indent - The indentation style for stylistic rules.
625
- * @returns A promise that resolves to the ESLint configuration array.
626
- */
627
- declare function toml(options?: FilesOptions & OverridesOptions & StylisticOptions): Promise<ConfigArray>;
628
-
629
- /**
630
- * Generates a TypeScript ESLint configuration.
631
- *
632
- * @param options - Configuration options that include overrides, stylistic preferences, and parser options.
633
- * @param options.stylistic - A boolean indicating whether stylistic rules should be included. Defaults to true.
634
- * @param options.parserOptions - Options for the TypeScript parser.
635
- * @param options.overrides - Additional rule overrides.
636
- * @returns A ConfigArray containing the TypeScript ESLint configuration.
637
- */
638
- declare function typescript(options?: OverridesOptions & StylisticOptions & TypeScriptParserOptions): ConfigArray;
639
-
640
- /**
641
- * Generates a configuration array for the Unicorn plugin with the specified options.
642
- *
643
- * @param [options] - The options to customize the Unicorn rules.
644
- * @returns The configuration array for the Unicorn plugin.
645
- */
646
- declare function unicorn(options?: UnicornOptions): ConfigArray;
647
-
648
- /**
649
- * Configures and returns an ESLint configuration array for Vitest.
650
- *
651
- * @param [options] - The options to customize the configuration.
652
- * @param [options.overrides] - Custom rule overrides.
653
- * @param [options.useJestDom] - Whether to use the `@testing-library/jest-dom` plugin.
654
- * @param [options.useTestingLibrary] - Whether to use the `@testing-library/angular` plugin.
655
- * @returns A promise that resolves to the ESLint configuration array.
656
- * @example
657
- * const config = await vitest({
658
- * overrides: {
659
- * 'no-console': 'warn',
660
- * },
661
- * useJestDom: true,
662
- * useTestingLibrary: false,
663
- * });
664
- */
665
- declare function vitest(options?: OverridesOptions & TestingOptions): Promise<ConfigArray>;
666
-
667
- /**
668
- * Generates an ESLint configuration for YAML files.
669
- *
670
- * @param options - Configuration options for the YAML setup.
671
- * @param options.files - An array of glob patterns to specify the YAML files to lint. Defaults to `[GLOB_YAML]`.
672
- * @param options.overrides - An object containing rule overrides.
673
- * @param options.stylistic - A boolean or object to specify stylistic rules. Defaults to `true`.
674
- * @param options.stylistic.indent - The number of spaces for indentation or 'tab'. Defaults to `2`.
675
- * @param options.stylistic.quotes - The type of quotes to use ('single', 'double', or 'backtick'). Defaults to `'single'`.
676
- * @returns A promise that resolves to a `ConfigArray` containing the ESLint configuration.
677
- */
678
- declare function yaml(options?: FilesOptions & OverridesOptions & StylisticOptions): Promise<ConfigArray>;
679
-
680
- /**
681
- * Creates an ESLint configuration array based on the provided options and user configurations.
682
- *
683
- * @param options - Configuration options that extend `ConfigWithExtends` and `CreateConfigOptions`.
684
- * @param userConfigs - Additional user configurations that can be awaited.
685
- * @returns A promise that resolves to a `ConfigArray`.
686
- * @throws Will throw an error if both `jest` and `vitest` are enabled.
687
- * @example
688
- * ```typescript
689
- * const config = await createConfig({ jest: true, typescript: { parserOptions: { project: './tsconfig.json' } } });
690
- * ```
691
- */
692
- declare function createConfig(options?: ConfigWithExtends & CreateConfigOptions, ...userConfigs: Awaitable<ConfigWithExtends | ConfigWithExtends[]>[]): Promise<ConfigArray>;
693
-
694
- /**
695
- * A glob pattern that matches JavaScript and TypeScript source files (including JSX/TSX).
696
- */
697
- declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
698
- /**
699
- * A glob pattern that matches JavaScript source files (including JSX).
700
- */
701
- declare const GLOB_JS = "**/*.?([cm])js?(x)";
702
- /**
703
- * A glob pattern that matches TypeScript source files (including TSX).
704
- */
705
- declare const GLOB_TS = "**/*.?([cm])ts?(x)";
706
- /**
707
- * A glob pattern that matches HTML files.
708
- */
709
- declare const GLOB_HTML = "**/*.htm?(l)";
710
- /**
711
- * A glob pattern that matches test files.
712
- */
713
- declare const GLOB_TESTS: string[];
714
-
715
- /**
716
- * Determines if the current environment is an editor environment.
717
- *
718
- * This function checks various environment variables to determine if the code
719
- * is running within a known editor environment such as VSCode, IntelliJ, JetBrains,
720
- * Vim, or NeoVim. It also ensures that the code is not running in a CI environment
721
- * or within git hooks.
722
- *
723
- * @returns `true` if the code is running in an editor environment, otherwise `false`.
724
- */
725
- declare function isInEditorEnv(): boolean;
726
- /**
727
- * Converts a value to an array. If the value is already an array, it returns the value as is.
728
- * Otherwise, it wraps the value in an array.
729
- *
730
- * @template T - The type of the value.
731
- * @param value - The value to convert to an array.
732
- * @returns The value converted to an array.
733
- */
734
- declare function toArray<T>(value: T | T[]): T[];
735
- /**
736
- * A utility function to handle the default export of a module.
737
- *
738
- * This function takes an `Awaitable` module and returns its default export if it exists,
739
- * otherwise, it returns the module itself.
740
- *
741
- * @template T - The type of the module.
742
- * @param m - The module to resolve.
743
- * @returns A promise that resolves to the default export of the module if it exists, otherwise the module itself.
744
- */
745
- declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
746
- default: infer U;
747
- } ? U : T>;
748
- /**
749
- * Retrieves the root directory of the workspace.
750
- *
751
- * This function determines the root directory of the workspace by checking for specific files
752
- * and directories that indicate the presence of an Nx workspace. If the `NX_WORKSPACE_ROOT_PATH`
753
- * environment variable is set, it returns that value. Otherwise, it recursively checks parent
754
- * directories until it finds the workspace root or reaches the filesystem root.
755
- *
756
- * @param dir - The current directory to start the search from.
757
- * @param candidateRoot - The initial candidate root directory.
758
- * @returns The root directory of the workspace.
759
- */
760
- declare function getWorkspaceRoot(dir: string, candidateRoot: string): string;
761
- /**
762
- * Checks if a package is within the specified scope.
763
- *
764
- * @param name - The name of the package to check.
765
- * @returns A boolean indicating whether the package is in scope.
766
- */
767
- declare function isPackageInScope(name: string): boolean;
768
- /**
769
- * Ensures that the specified packages are installed. If running in a CI environment,
770
- * or if the terminal is not interactive, or if the current working directory is not in scope,
771
- * the function will return immediately without doing anything.
772
- *
773
- * The function filters out packages that are already in scope and prompts the user to confirm
774
- * the installation of the remaining packages. If the user confirms, the packages are installed
775
- * as development dependencies.
776
- *
777
- * @param packages - An array of package names (or undefined) to check and install if necessary.
778
- * @returns A promise that resolves when the operation is complete.
779
- */
780
- declare function ensurePackages(packages: (string | undefined)[]): Promise<void>;
781
-
782
- export { type AngularOptions, type Awaitable, type CreateConfigOptions, type FilesOptions, type FormattersOptions, GLOB_HTML, GLOB_JS, GLOB_SRC, GLOB_TESTS, GLOB_TS, type IsInEditorOptions, type NgrxOperators, type NgrxOptions, type OverridesOptions, STYLISTIC_CONFIG_DEFAULT, type StylisticConfig, type StylisticOptions, type TestingOptions, type TypeScriptParserOptions, type UnicornOptions, angular, comments, createConfig, ensurePackages, getWorkspaceRoot, ignores, imports, interopDefault, isInEditorEnv, isPackageInScope, javascript, jest, jsdoc, jsonc, markdown, ngrx, perfectionist, sortPackageJson, sortTsConfig, stylistic, tailwindcss, toArray, toml, typescript, unicorn, vitest, yaml };