@eslint-sets/eslint-config 6.2.0-beta.4 → 6.2.0-beta.5
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 +57 -11
- package/dist/configs/index.d.ts +2 -0
- package/dist/configs/index.d.ts.map +1 -1
- package/dist/configs/jsonc.d.ts +2 -2
- package/dist/configs/jsonc.d.ts.map +1 -1
- package/dist/configs/prettier.d.ts +2 -2
- package/dist/configs/stylistic.d.ts +2 -2
- package/dist/configs/toml.d.ts +22 -1
- package/dist/configs/toml.d.ts.map +1 -1
- package/dist/configs/typescript.d.ts +2 -16
- package/dist/configs/typescript.d.ts.map +1 -1
- package/dist/configs/vue.d.ts +2 -2
- package/dist/configs/vue.d.ts.map +1 -1
- package/dist/configs/yaml.d.ts +22 -1
- package/dist/configs/yaml.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +208 -47
- package/dist/types.d.ts +87 -7
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -234,13 +234,15 @@ export default eslintConfig({
|
|
|
234
234
|
|
|
235
235
|
// Or with custom options:
|
|
236
236
|
stylistic: {
|
|
237
|
-
arrowParens:
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
237
|
+
arrowParens: false, // true (always) | false (avoid) - default: false
|
|
238
|
+
braceStyle: '1tbs', // '1tbs' | 'stroustrup' | 'allman' - default: '1tbs'
|
|
239
|
+
bracketSpacing: true, // boolean - default: true
|
|
240
|
+
indent: 2, // 'tab' | number - default: 2
|
|
241
|
+
jsxQuotes: 'prefer-double', // 'prefer-double' | 'prefer-single' - default: 'prefer-double'
|
|
242
|
+
quoteProps: 'consistent-as-needed', // 'always' | 'as-needed' | 'consistent' | 'consistent-as-needed' - default: 'consistent-as-needed'
|
|
243
|
+
quotes: 'single', // 'single' | 'double' - default: 'single'
|
|
244
|
+
semi: false, // boolean - default: false
|
|
245
|
+
trailingComma: 'always-multiline', // 'none' | 'always' | 'never' | 'only-multiline' | 'always-multiline' - default: 'always-multiline'
|
|
244
246
|
},
|
|
245
247
|
|
|
246
248
|
// Svelte support (default: 'auto' - auto-detect)
|
|
@@ -304,13 +306,15 @@ export default eslintConfig({
|
|
|
304
306
|
// Use Stylistic with custom options
|
|
305
307
|
export default eslintConfig({
|
|
306
308
|
stylistic: {
|
|
307
|
-
arrowParens:
|
|
309
|
+
arrowParens: false, // true (always) | false (avoid)
|
|
310
|
+
braceStyle: '1tbs', // '1tbs' | 'stroustrup' | 'allman'
|
|
308
311
|
bracketSpacing: true, // boolean
|
|
309
312
|
indent: 2, // 'tab' | number
|
|
310
313
|
jsxQuotes: 'prefer-double', // 'prefer-double' | 'prefer-single'
|
|
314
|
+
quoteProps: 'consistent-as-needed', // 'always' | 'as-needed' | 'consistent' | 'consistent-as-needed'
|
|
311
315
|
quotes: 'single', // 'single' | 'double'
|
|
312
316
|
semi: false, // boolean
|
|
313
|
-
trailingComma: 'always-multiline', // 'none' | '
|
|
317
|
+
trailingComma: 'always-multiline', // 'none' | 'always' | 'never' | 'only-multiline' | 'always-multiline'
|
|
314
318
|
},
|
|
315
319
|
})
|
|
316
320
|
|
|
@@ -323,7 +327,7 @@ export default eslintConfig({
|
|
|
323
327
|
// Use Prettier with custom options
|
|
324
328
|
export default eslintConfig({
|
|
325
329
|
prettier: {
|
|
326
|
-
printWidth:
|
|
330
|
+
printWidth: 180,
|
|
327
331
|
semi: false,
|
|
328
332
|
singleQuote: true,
|
|
329
333
|
tabWidth: 2,
|
|
@@ -351,7 +355,7 @@ You can override these defaults in your config:
|
|
|
351
355
|
export default eslintConfig({
|
|
352
356
|
rules: {
|
|
353
357
|
// Add line length limit if needed
|
|
354
|
-
'@stylistic/max-len': ['error', { code:
|
|
358
|
+
'@stylistic/max-len': ['error', { code: 180 }],
|
|
355
359
|
|
|
356
360
|
// Prefer imports over globals
|
|
357
361
|
'n/prefer-global/buffer': ['error', 'never'],
|
|
@@ -394,6 +398,48 @@ export default eslintConfig({
|
|
|
394
398
|
})
|
|
395
399
|
```
|
|
396
400
|
|
|
401
|
+
### TypeScript Advanced Options
|
|
402
|
+
|
|
403
|
+
```typescript
|
|
404
|
+
// Type-aware rules (requires tsconfig.json)
|
|
405
|
+
export default eslintConfig({
|
|
406
|
+
typescript: {
|
|
407
|
+
typeAware: true,
|
|
408
|
+
tsconfigPath: './tsconfig.json',
|
|
409
|
+
overridesTypeAware: {
|
|
410
|
+
'ts/no-floating-promises': 'warn',
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
})
|
|
414
|
+
|
|
415
|
+
// Library project with explicit return types
|
|
416
|
+
export default eslintConfig({
|
|
417
|
+
type: 'lib', // Enables ts/explicit-function-return-type
|
|
418
|
+
typescript: true,
|
|
419
|
+
})
|
|
420
|
+
|
|
421
|
+
// Erasable syntax only (for libraries that want type-only constructs)
|
|
422
|
+
export default eslintConfig({
|
|
423
|
+
typescript: {
|
|
424
|
+
erasableOnly: true, // Requires eslint-plugin-erasable-syntax-only
|
|
425
|
+
},
|
|
426
|
+
})
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### Disabling Stylistic Rules per Config
|
|
430
|
+
|
|
431
|
+
You can disable stylistic rules for specific configs:
|
|
432
|
+
|
|
433
|
+
```typescript
|
|
434
|
+
// Disable stylistic rules for JSON files
|
|
435
|
+
export default eslintConfig({
|
|
436
|
+
jsonc: { stylistic: false },
|
|
437
|
+
yaml: { stylistic: false },
|
|
438
|
+
toml: { stylistic: false },
|
|
439
|
+
vue: { stylistic: false },
|
|
440
|
+
})
|
|
441
|
+
```
|
|
442
|
+
|
|
397
443
|
### Framework-Specific Configurations
|
|
398
444
|
|
|
399
445
|
#### Vue Project
|
package/dist/configs/index.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ export * from '../plugins';
|
|
|
44
44
|
export type { FrameworkOptions, Linter, Options, OptionsOverrides, ProjectType } from '../types';
|
|
45
45
|
export * from '../utils';
|
|
46
46
|
export type { ReactOptions } from './react';
|
|
47
|
+
export type { TomlOptions } from './toml';
|
|
47
48
|
export type { TypeScriptOptions } from './typescript';
|
|
48
49
|
export type { VueOptions } from './vue';
|
|
50
|
+
export type { YamlOptions } from './yaml';
|
|
49
51
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,OAAO,EAA0C,MAAM,UAAU,CAAA;AA0B/E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ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;AACzC,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,YAAY,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACvC,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA"}
|
package/dist/configs/jsonc.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
|
-
import type { OptionsOverrides } from '../types';
|
|
2
|
+
import type { OptionsOverrides, OptionsStylistic } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* JSON/JSONC configuration options
|
|
5
5
|
*/
|
|
6
|
-
export type JsoncOptions = OptionsOverrides;
|
|
6
|
+
export type JsoncOptions = OptionsOverrides & OptionsStylistic;
|
|
7
7
|
/**
|
|
8
8
|
* JSON/JSONC/JSON5 configuration
|
|
9
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonc.d.ts","sourceRoot":"","sources":["../../src/configs/jsonc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"jsonc.d.ts","sourceRoot":"","sources":["../../src/configs/jsonc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAKlE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,gBAAgB,CAAA;AAE9D;;GAEG;AACH,wBAAgB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,CAqEjE"}
|
|
@@ -7,7 +7,7 @@ import type { Linter } from 'eslint';
|
|
|
7
7
|
export interface PrettierOptions {
|
|
8
8
|
/**
|
|
9
9
|
* Arrow function parentheses
|
|
10
|
-
* @default '
|
|
10
|
+
* @default 'avoid'
|
|
11
11
|
*/
|
|
12
12
|
arrowParens?: 'always' | 'avoid';
|
|
13
13
|
/**
|
|
@@ -31,7 +31,7 @@ export interface PrettierOptions {
|
|
|
31
31
|
overrides?: Linter.RulesRecord;
|
|
32
32
|
/**
|
|
33
33
|
* Print width
|
|
34
|
-
* @default
|
|
34
|
+
* @default 180
|
|
35
35
|
*/
|
|
36
36
|
printWidth?: number;
|
|
37
37
|
/**
|
|
@@ -5,7 +5,7 @@ import type { Linter } from 'eslint';
|
|
|
5
5
|
export interface StylisticOptions {
|
|
6
6
|
/**
|
|
7
7
|
* Arrow function parentheses
|
|
8
|
-
* @default
|
|
8
|
+
* @default false
|
|
9
9
|
*/
|
|
10
10
|
arrowParens?: boolean;
|
|
11
11
|
/**
|
|
@@ -39,7 +39,7 @@ export interface StylisticOptions {
|
|
|
39
39
|
overrides?: Linter.RulesRecord;
|
|
40
40
|
/**
|
|
41
41
|
* Quote props
|
|
42
|
-
* @default 'as-needed'
|
|
42
|
+
* @default 'consistent-as-needed'
|
|
43
43
|
*/
|
|
44
44
|
quoteProps?: 'always' | 'as-needed' | 'consistent' | 'consistent-as-needed';
|
|
45
45
|
/**
|
package/dist/configs/toml.d.ts
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
|
+
import type { OptionsOverrides } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Stylistic options for TOML config
|
|
5
|
+
*/
|
|
6
|
+
export interface TomlStylisticOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Indentation style
|
|
9
|
+
* @default 2
|
|
10
|
+
*/
|
|
11
|
+
indent?: number | 'tab';
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* TOML configuration options
|
|
15
|
+
*/
|
|
16
|
+
export interface TomlOptions extends OptionsOverrides {
|
|
17
|
+
/**
|
|
18
|
+
* Enable stylistic rules
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
stylistic?: boolean | TomlStylisticOptions;
|
|
22
|
+
}
|
|
2
23
|
/**
|
|
3
24
|
* TOML configuration
|
|
4
25
|
*/
|
|
5
|
-
export declare function toml(): Linter.Config[];
|
|
26
|
+
export declare function toml(options?: TomlOptions): Linter.Config[];
|
|
6
27
|
//# sourceMappingURL=toml.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toml.d.ts","sourceRoot":"","sources":["../../src/configs/toml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"toml.d.ts","sourceRoot":"","sources":["../../src/configs/toml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAShD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACpD;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,oBAAoB,CAAA;CAC1C;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,CAoD/D"}
|
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
|
-
import type { OptionsOverrides } from '../types';
|
|
2
|
+
import type { OptionsOverrides, OptionsProjectType, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* TypeScript configuration options
|
|
5
5
|
*/
|
|
6
|
-
export interface TypeScriptOptions extends OptionsOverrides {
|
|
7
|
-
/**
|
|
8
|
-
* Glob patterns for files that should be type aware
|
|
9
|
-
* @default ['**\/*.{ts,tsx}']
|
|
10
|
-
*/
|
|
11
|
-
filesTypeAware?: string[];
|
|
12
|
-
/**
|
|
13
|
-
* Glob patterns for files that should not be type aware
|
|
14
|
-
*/
|
|
15
|
-
ignoresTypeAware?: string[];
|
|
16
|
-
/**
|
|
17
|
-
* Path to tsconfig.json
|
|
18
|
-
* @default './tsconfig.json'
|
|
19
|
-
*/
|
|
20
|
-
tsconfigPath?: string | string[];
|
|
6
|
+
export interface TypeScriptOptions extends OptionsOverrides, OptionsTypeScriptWithTypes, OptionsTypeScriptParserOptions, OptionsProjectType, OptionsTypeScriptErasableOnly {
|
|
21
7
|
/**
|
|
22
8
|
* Enable rules that require type information
|
|
23
9
|
* @default false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/configs/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/configs/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAO/J;;GAEG;AACH,MAAM,WAAW,iBAChB,SAAQ,gBAAgB,EACvB,0BAA0B,EAC1B,8BAA8B,EAC9B,kBAAkB,EAClB,6BAA6B;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACnB;AAKD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAwM1F"}
|
package/dist/configs/vue.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
|
-
import type { OptionsOverrides } from '../types';
|
|
2
|
+
import type { OptionsOverrides, OptionsStylistic } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Vue configuration options
|
|
5
5
|
*/
|
|
6
|
-
export interface VueOptions extends OptionsOverrides {
|
|
6
|
+
export interface VueOptions extends OptionsOverrides, OptionsStylistic {
|
|
7
7
|
/**
|
|
8
8
|
* Enable Vue accessibility rules
|
|
9
9
|
* Requires eslint-plugin-vuejs-accessibility
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../../src/configs/vue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../../src/configs/vue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAMlE;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,gBAAgB,EAAE,gBAAgB;IACrE;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;CAClB;AAOD;;GAEG;AACH,wBAAsB,GAAG,CAAC,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CA2I5E"}
|
package/dist/configs/yaml.d.ts
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
2
|
import type { OptionsOverrides } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Stylistic options for YAML config
|
|
5
|
+
*/
|
|
6
|
+
export interface YamlStylisticOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Indentation style
|
|
9
|
+
* @default 2
|
|
10
|
+
*/
|
|
11
|
+
indent?: number | 'tab';
|
|
12
|
+
/**
|
|
13
|
+
* Quote style
|
|
14
|
+
* @default 'single'
|
|
15
|
+
*/
|
|
16
|
+
quotes?: 'single' | 'double';
|
|
17
|
+
}
|
|
3
18
|
/**
|
|
4
19
|
* YAML configuration options
|
|
5
20
|
*/
|
|
6
|
-
export
|
|
21
|
+
export interface YamlOptions extends OptionsOverrides {
|
|
22
|
+
/**
|
|
23
|
+
* Enable stylistic rules
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
stylistic?: boolean | YamlStylisticOptions;
|
|
27
|
+
}
|
|
7
28
|
/**
|
|
8
29
|
* YAML configuration
|
|
9
30
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../src/configs/yaml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAKhD;;GAEG;AACH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../src/configs/yaml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAKhD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IAEvB;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACpD;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,oBAAoB,CAAA;CAC1C;AAKD;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,CAwD/D"}
|
package/dist/index.d.ts
CHANGED
|
@@ -21,8 +21,10 @@ export { config } from './configs';
|
|
|
21
21
|
export type { PrettierOptions } from './configs/prettier';
|
|
22
22
|
export type { ReactOptions } from './configs/react';
|
|
23
23
|
export type { StylisticOptions } from './configs/stylistic';
|
|
24
|
+
export type { TomlOptions } from './configs/toml';
|
|
24
25
|
export type { TypeScriptOptions } from './configs/typescript';
|
|
25
26
|
export type { VueOptions } from './configs/vue';
|
|
27
|
+
export type { YamlOptions } from './configs/yaml';
|
|
26
28
|
export * from './constants';
|
|
27
29
|
export * from './plugins';
|
|
28
30
|
export type { ConfigNames, FrameworkOptions, Linter, Options, OptionsOverrides, PerfectionistOptions, ProjectType, Rules, TypedFlatConfigItem } from './types';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGtC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAEhF;AAGD,cAAc,WAAW,CAAA;AAGzB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEzD,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEnD,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;A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EAAE,oBAAoB,EAAE,WAAW,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAE9J,cAAc,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -936,22 +936,30 @@ function javascript(options = {}) {
|
|
|
936
936
|
import jsoncPlugin from "eslint-plugin-jsonc";
|
|
937
937
|
import jsoncParser from "jsonc-eslint-parser";
|
|
938
938
|
function jsonc(options = {}) {
|
|
939
|
-
const {
|
|
939
|
+
const {
|
|
940
|
+
overrides = {},
|
|
941
|
+
stylistic: stylistic2 = true
|
|
942
|
+
} = options;
|
|
943
|
+
const {
|
|
944
|
+
indent = 2
|
|
945
|
+
} = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
940
946
|
return [
|
|
941
947
|
{
|
|
942
948
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
943
949
|
languageOptions: {
|
|
944
950
|
parser: jsoncParser
|
|
945
951
|
},
|
|
946
|
-
name: "eslint-sets/jsonc
|
|
952
|
+
name: "eslint-sets/jsonc",
|
|
947
953
|
plugins: {
|
|
948
954
|
jsonc: jsoncPlugin
|
|
949
955
|
},
|
|
950
956
|
rules: {
|
|
951
|
-
//
|
|
957
|
+
// JSON core rules (always enabled)
|
|
952
958
|
"jsonc/no-bigint-literals": "error",
|
|
953
959
|
"jsonc/no-binary-expression": "error",
|
|
954
960
|
"jsonc/no-binary-numeric-literals": "error",
|
|
961
|
+
"jsonc/no-dupe-keys": "error",
|
|
962
|
+
"jsonc/no-escape-sequence-in-identifier": "error",
|
|
955
963
|
"jsonc/no-floating-decimal": "error",
|
|
956
964
|
"jsonc/no-hexadecimal-numeric-literals": "error",
|
|
957
965
|
"jsonc/no-infinity": "error",
|
|
@@ -965,14 +973,26 @@ function jsonc(options = {}) {
|
|
|
965
973
|
"jsonc/no-parenthesized": "error",
|
|
966
974
|
"jsonc/no-plus-sign": "error",
|
|
967
975
|
"jsonc/no-regexp-literals": "error",
|
|
976
|
+
"jsonc/no-sparse-arrays": "error",
|
|
968
977
|
"jsonc/no-template-literals": "error",
|
|
969
978
|
"jsonc/no-undefined-value": "error",
|
|
970
979
|
"jsonc/no-unicode-codepoint-escapes": "error",
|
|
971
980
|
"jsonc/no-useless-escape": "error",
|
|
972
|
-
"jsonc/sort-array-values": "off",
|
|
973
|
-
"jsonc/sort-keys": "off",
|
|
974
981
|
"jsonc/space-unary-ops": "error",
|
|
975
982
|
"jsonc/valid-json-number": "error",
|
|
983
|
+
// Stylistic rules (conditional)
|
|
984
|
+
...stylistic2 ? {
|
|
985
|
+
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
986
|
+
"jsonc/comma-dangle": ["error", "never"],
|
|
987
|
+
"jsonc/comma-style": ["error", "last"],
|
|
988
|
+
"jsonc/indent": ["error", indent === "tab" ? "tab" : indent],
|
|
989
|
+
"jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
|
|
990
|
+
"jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
|
|
991
|
+
"jsonc/object-curly-spacing": ["error", "always"],
|
|
992
|
+
"jsonc/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
|
|
993
|
+
"jsonc/quote-props": "error",
|
|
994
|
+
"jsonc/quotes": "error"
|
|
995
|
+
} : {},
|
|
976
996
|
// User overrides
|
|
977
997
|
...overrides
|
|
978
998
|
}
|
|
@@ -1344,12 +1364,12 @@ import eslintConfigPrettier from "eslint-config-prettier";
|
|
|
1344
1364
|
import eslintPluginPrettier from "eslint-plugin-prettier";
|
|
1345
1365
|
function prettier(options = {}) {
|
|
1346
1366
|
const {
|
|
1347
|
-
arrowParens = "
|
|
1367
|
+
arrowParens = "avoid",
|
|
1348
1368
|
bracketSpacing = true,
|
|
1349
1369
|
endOfLine = "auto",
|
|
1350
1370
|
jsxSingleQuote = false,
|
|
1351
1371
|
overrides = {},
|
|
1352
|
-
printWidth =
|
|
1372
|
+
printWidth = 180,
|
|
1353
1373
|
quoteProps = "as-needed",
|
|
1354
1374
|
semi = false,
|
|
1355
1375
|
singleQuote = true,
|
|
@@ -1732,13 +1752,13 @@ async function sortTsconfig(options = {}) {
|
|
|
1732
1752
|
// src/configs/stylistic.ts
|
|
1733
1753
|
import stylisticPlugin from "@stylistic/eslint-plugin";
|
|
1734
1754
|
var StylisticConfigDefaults = {
|
|
1735
|
-
arrowParens:
|
|
1755
|
+
arrowParens: false,
|
|
1736
1756
|
braceStyle: "1tbs",
|
|
1737
1757
|
bracketSpacing: true,
|
|
1738
1758
|
indent: 2,
|
|
1739
1759
|
jsx: true,
|
|
1740
1760
|
jsxQuotes: "prefer-double",
|
|
1741
|
-
quoteProps: "as-needed",
|
|
1761
|
+
quoteProps: "consistent-as-needed",
|
|
1742
1762
|
quotes: "single",
|
|
1743
1763
|
semi: false,
|
|
1744
1764
|
trailingComma: "always-multiline"
|
|
@@ -2001,7 +2021,14 @@ function test(options = {}) {
|
|
|
2001
2021
|
import tomlPlugin from "eslint-plugin-toml";
|
|
2002
2022
|
import * as tomlParser from "toml-eslint-parser";
|
|
2003
2023
|
var GLOB_TOML = "**/*.toml";
|
|
2004
|
-
function toml() {
|
|
2024
|
+
function toml(options = {}) {
|
|
2025
|
+
const {
|
|
2026
|
+
overrides = {},
|
|
2027
|
+
stylistic: stylistic2 = true
|
|
2028
|
+
} = options;
|
|
2029
|
+
const {
|
|
2030
|
+
indent = 2
|
|
2031
|
+
} = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
2005
2032
|
return [
|
|
2006
2033
|
{
|
|
2007
2034
|
files: [GLOB_TOML],
|
|
@@ -2013,57 +2040,81 @@ function toml() {
|
|
|
2013
2040
|
toml: tomlPlugin
|
|
2014
2041
|
},
|
|
2015
2042
|
rules: {
|
|
2016
|
-
// TOML
|
|
2017
|
-
"toml/comma-style":
|
|
2018
|
-
"toml/
|
|
2019
|
-
"toml/keys-order": "off",
|
|
2043
|
+
// TOML core rules (always enabled)
|
|
2044
|
+
"toml/comma-style": "error",
|
|
2045
|
+
"toml/keys-order": "error",
|
|
2020
2046
|
"toml/no-space-dots": "error",
|
|
2021
2047
|
"toml/no-unreadable-number-separator": "error",
|
|
2022
|
-
"toml/precision-of-fractional-seconds": "
|
|
2023
|
-
"toml/
|
|
2048
|
+
"toml/precision-of-fractional-seconds": "error",
|
|
2049
|
+
"toml/precision-of-integer": "error",
|
|
2050
|
+
"toml/tables-order": "error",
|
|
2051
|
+
// Stylistic rules (conditional)
|
|
2052
|
+
...stylistic2 ? {
|
|
2053
|
+
"toml/array-bracket-newline": "error",
|
|
2054
|
+
"toml/array-bracket-spacing": "error",
|
|
2055
|
+
"toml/array-element-newline": "error",
|
|
2056
|
+
"toml/indent": ["error", indent === "tab" ? "tab" : indent],
|
|
2057
|
+
"toml/inline-table-curly-spacing": "error",
|
|
2058
|
+
"toml/key-spacing": "error",
|
|
2059
|
+
"toml/padding-line-between-pairs": "error",
|
|
2060
|
+
"toml/padding-line-between-tables": "error",
|
|
2061
|
+
"toml/quoted-keys": "error",
|
|
2062
|
+
"toml/spaced-comment": "error",
|
|
2063
|
+
"toml/table-bracket-spacing": "error"
|
|
2064
|
+
} : {},
|
|
2065
|
+
// User overrides
|
|
2066
|
+
...overrides
|
|
2024
2067
|
}
|
|
2025
2068
|
}
|
|
2026
2069
|
];
|
|
2027
2070
|
}
|
|
2028
2071
|
|
|
2029
2072
|
// src/configs/typescript.ts
|
|
2073
|
+
import process2 from "node:process";
|
|
2030
2074
|
import tsParser from "@typescript-eslint/parser";
|
|
2031
2075
|
async function typescript(options = {}) {
|
|
2032
2076
|
const {
|
|
2033
2077
|
filesTypeAware = [GLOB_TS],
|
|
2034
2078
|
ignoresTypeAware = ["**/*.md/**", "**/*.astro/*.ts"],
|
|
2035
2079
|
overrides = {},
|
|
2036
|
-
|
|
2037
|
-
|
|
2080
|
+
overridesTypeAware = {},
|
|
2081
|
+
parserOptions = {},
|
|
2082
|
+
tsconfigPath,
|
|
2083
|
+
type = "app",
|
|
2084
|
+
typeAware = false,
|
|
2085
|
+
erasableOnly = false
|
|
2038
2086
|
} = options;
|
|
2039
2087
|
const tseslint = await loadPlugin("@typescript-eslint/eslint-plugin");
|
|
2040
2088
|
if (!tseslint) {
|
|
2041
2089
|
return [];
|
|
2042
2090
|
}
|
|
2043
|
-
const isTypeAware = typeAware && tsconfigPath;
|
|
2044
|
-
const tsconfigPaths = Array.isArray(tsconfigPath) ? tsconfigPath : [tsconfigPath];
|
|
2091
|
+
const isTypeAware = typeAware && !!tsconfigPath;
|
|
2045
2092
|
const recommendedRules = tseslint.configs.recommended.rules;
|
|
2046
2093
|
const strictRules = tseslint.configs.strict?.rules || {};
|
|
2047
2094
|
const tsRecommendedRules = renameRules(recommendedRules, "ts");
|
|
2048
2095
|
const tsStrictRules = renameRules(strictRules, "ts");
|
|
2049
2096
|
const typeAwareRules = {
|
|
2050
2097
|
// Turn off base rules
|
|
2098
|
+
"dot-notation": "off",
|
|
2051
2099
|
"no-implied-eval": "off",
|
|
2052
|
-
"no-throw-literal": "off",
|
|
2053
2100
|
"ts/await-thenable": "error",
|
|
2101
|
+
"ts/dot-notation": ["error", { allowKeywords: true }],
|
|
2054
2102
|
"ts/no-floating-promises": "error",
|
|
2055
2103
|
"ts/no-for-in-array": "error",
|
|
2056
2104
|
"ts/no-implied-eval": "error",
|
|
2057
2105
|
"ts/no-misused-promises": "error",
|
|
2058
|
-
"ts/no-throw-literal": "error",
|
|
2059
2106
|
"ts/no-unnecessary-type-assertion": "error",
|
|
2060
2107
|
"ts/no-unsafe-argument": "error",
|
|
2061
2108
|
"ts/no-unsafe-assignment": "error",
|
|
2062
2109
|
"ts/no-unsafe-call": "error",
|
|
2063
2110
|
"ts/no-unsafe-member-access": "error",
|
|
2064
2111
|
"ts/no-unsafe-return": "error",
|
|
2112
|
+
"ts/promise-function-async": "error",
|
|
2065
2113
|
"ts/restrict-plus-operands": "error",
|
|
2066
2114
|
"ts/restrict-template-expressions": "error",
|
|
2115
|
+
"ts/return-await": ["error", "in-try-catch"],
|
|
2116
|
+
"ts/strict-boolean-expressions": ["error", { allowNullableBoolean: true, allowNullableObject: true }],
|
|
2117
|
+
"ts/switch-exhaustiveness-check": "error",
|
|
2067
2118
|
"ts/unbound-method": "error"
|
|
2068
2119
|
};
|
|
2069
2120
|
const configs = [
|
|
@@ -2075,8 +2126,13 @@ async function typescript(options = {}) {
|
|
|
2075
2126
|
ecmaVersion: "latest",
|
|
2076
2127
|
sourceType: "module",
|
|
2077
2128
|
...isTypeAware ? {
|
|
2078
|
-
|
|
2079
|
-
|
|
2129
|
+
projectService: {
|
|
2130
|
+
allowDefaultProject: ["./*.js"],
|
|
2131
|
+
defaultProject: tsconfigPath
|
|
2132
|
+
},
|
|
2133
|
+
tsconfigRootDir: process2.cwd()
|
|
2134
|
+
} : {},
|
|
2135
|
+
...parserOptions
|
|
2080
2136
|
}
|
|
2081
2137
|
},
|
|
2082
2138
|
name: "eslint-sets/typescript",
|
|
@@ -2089,22 +2145,25 @@ async function typescript(options = {}) {
|
|
|
2089
2145
|
...tsStrictRules,
|
|
2090
2146
|
// Override JavaScript rules
|
|
2091
2147
|
"no-dupe-class-members": "off",
|
|
2092
|
-
"no-loss-of-precision": "off",
|
|
2093
2148
|
"no-redeclare": "off",
|
|
2094
2149
|
"no-use-before-define": "off",
|
|
2095
2150
|
"no-useless-constructor": "off",
|
|
2096
2151
|
// Essential custom rules
|
|
2097
|
-
"ts/ban-ts-comment": ["error", { "ts-
|
|
2152
|
+
"ts/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
|
|
2098
2153
|
"ts/consistent-type-definitions": ["error", "interface"],
|
|
2099
|
-
"ts/consistent-type-imports": ["error", {
|
|
2154
|
+
"ts/consistent-type-imports": ["error", {
|
|
2155
|
+
disallowTypeAnnotations: false,
|
|
2156
|
+
fixStyle: "separate-type-imports",
|
|
2157
|
+
prefer: "type-imports"
|
|
2158
|
+
}],
|
|
2159
|
+
"ts/method-signature-style": ["error", "property"],
|
|
2100
2160
|
"ts/no-dynamic-delete": "off",
|
|
2101
2161
|
"ts/no-explicit-any": "off",
|
|
2102
2162
|
"ts/no-extraneous-class": "off",
|
|
2103
2163
|
"ts/no-import-type-side-effects": "error",
|
|
2104
2164
|
"ts/no-invalid-void-type": "off",
|
|
2105
2165
|
"ts/no-non-null-assertion": "off",
|
|
2106
|
-
|
|
2107
|
-
"ts/no-redeclare": "error",
|
|
2166
|
+
"ts/no-redeclare": ["error", { builtinGlobals: false }],
|
|
2108
2167
|
"ts/no-require-imports": "error",
|
|
2109
2168
|
"ts/no-unused-expressions": ["error", {
|
|
2110
2169
|
allowShortCircuit: true,
|
|
@@ -2114,9 +2173,17 @@ async function typescript(options = {}) {
|
|
|
2114
2173
|
"ts/no-unused-vars": "off",
|
|
2115
2174
|
"ts/no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
|
|
2116
2175
|
"ts/no-useless-constructor": "off",
|
|
2117
|
-
"ts/
|
|
2176
|
+
"ts/no-wrapper-object-types": "error",
|
|
2118
2177
|
"ts/triple-slash-reference": "off",
|
|
2119
2178
|
"ts/unified-signatures": "off",
|
|
2179
|
+
// Library-specific rules
|
|
2180
|
+
...type === "lib" ? {
|
|
2181
|
+
"ts/explicit-function-return-type": ["error", {
|
|
2182
|
+
allowExpressions: true,
|
|
2183
|
+
allowHigherOrderFunctions: true,
|
|
2184
|
+
allowIIFEs: true
|
|
2185
|
+
}]
|
|
2186
|
+
} : {},
|
|
2120
2187
|
// User overrides
|
|
2121
2188
|
...overrides
|
|
2122
2189
|
}
|
|
@@ -2127,9 +2194,29 @@ async function typescript(options = {}) {
|
|
|
2127
2194
|
files: filesTypeAware,
|
|
2128
2195
|
ignores: ignoresTypeAware,
|
|
2129
2196
|
name: "eslint-sets/typescript/type-aware",
|
|
2130
|
-
rules:
|
|
2197
|
+
rules: {
|
|
2198
|
+
...typeAwareRules,
|
|
2199
|
+
...overridesTypeAware
|
|
2200
|
+
}
|
|
2131
2201
|
});
|
|
2132
2202
|
}
|
|
2203
|
+
if (erasableOnly) {
|
|
2204
|
+
const erasablePlugin = await interopDefault(import("eslint-plugin-erasable-syntax-only"));
|
|
2205
|
+
if (erasablePlugin) {
|
|
2206
|
+
configs.push({
|
|
2207
|
+
name: "eslint-sets/typescript/erasable-syntax-only",
|
|
2208
|
+
plugins: {
|
|
2209
|
+
"erasable-syntax-only": erasablePlugin
|
|
2210
|
+
},
|
|
2211
|
+
rules: {
|
|
2212
|
+
"erasable-syntax-only/enums": "error",
|
|
2213
|
+
"erasable-syntax-only/import-aliases": "error",
|
|
2214
|
+
"erasable-syntax-only/namespaces": "error",
|
|
2215
|
+
"erasable-syntax-only/parameter-properties": "error"
|
|
2216
|
+
}
|
|
2217
|
+
});
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2133
2220
|
configs.push({
|
|
2134
2221
|
files: ["**/*.d.ts"],
|
|
2135
2222
|
name: "eslint-sets/typescript/disables/dts",
|
|
@@ -2244,7 +2331,15 @@ async function unocss(options = {}) {
|
|
|
2244
2331
|
import vuePlugin from "eslint-plugin-vue";
|
|
2245
2332
|
import vueParser from "vue-eslint-parser";
|
|
2246
2333
|
async function vue(options = {}) {
|
|
2247
|
-
const {
|
|
2334
|
+
const {
|
|
2335
|
+
a11y = false,
|
|
2336
|
+
overrides = {},
|
|
2337
|
+
stylistic: stylistic2 = true,
|
|
2338
|
+
vueVersion = 3
|
|
2339
|
+
} = options;
|
|
2340
|
+
const {
|
|
2341
|
+
indent = 2
|
|
2342
|
+
} = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
2248
2343
|
const vueRecommendedRules = vueVersion === 2 ? {
|
|
2249
2344
|
...vuePlugin.configs["flat/vue2-essential"]?.rules || {},
|
|
2250
2345
|
...vuePlugin.configs["flat/vue2-strongly-recommended"]?.rules || {},
|
|
@@ -2279,13 +2374,54 @@ async function vue(options = {}) {
|
|
|
2279
2374
|
// Essential custom rules
|
|
2280
2375
|
"vue/block-order": ["error", { order: ["script", "template", "style"] }],
|
|
2281
2376
|
"vue/component-name-in-template-casing": ["error", "PascalCase"],
|
|
2282
|
-
"vue/
|
|
2377
|
+
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
2378
|
+
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
2379
|
+
"vue/define-macros-order": ["error", { order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"] }],
|
|
2380
|
+
"vue/dot-location": ["error", "property"],
|
|
2381
|
+
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
2382
|
+
"vue/eqeqeq": ["error", "smart"],
|
|
2283
2383
|
"vue/multi-word-component-names": "off",
|
|
2384
|
+
"vue/no-dupe-keys": "off",
|
|
2385
|
+
"vue/no-empty-pattern": "error",
|
|
2386
|
+
"vue/no-irregular-whitespace": "error",
|
|
2387
|
+
"vue/no-loss-of-precision": "error",
|
|
2284
2388
|
"vue/no-restricted-v-bind": ["error", "/^v-/"],
|
|
2389
|
+
"vue/no-setup-props-reactivity-loss": "off",
|
|
2390
|
+
"vue/no-sparse-arrays": "error",
|
|
2391
|
+
"vue/no-unused-refs": "error",
|
|
2392
|
+
"vue/no-useless-v-bind": "error",
|
|
2285
2393
|
"vue/no-v-html": "off",
|
|
2286
2394
|
"vue/prefer-separate-static-class": "error",
|
|
2395
|
+
"vue/prefer-template": "error",
|
|
2396
|
+
"vue/prop-name-casing": ["error", "camelCase"],
|
|
2287
2397
|
"vue/require-default-prop": "off",
|
|
2288
2398
|
"vue/require-prop-types": "off",
|
|
2399
|
+
"vue/space-infix-ops": "error",
|
|
2400
|
+
"vue/space-unary-ops": ["error", { nonwords: false, words: true }],
|
|
2401
|
+
// Stylistic rules (conditional)
|
|
2402
|
+
...stylistic2 ? {
|
|
2403
|
+
"vue/array-bracket-spacing": ["error", "never"],
|
|
2404
|
+
"vue/arrow-spacing": ["error", { after: true, before: true }],
|
|
2405
|
+
"vue/block-spacing": ["error", "always"],
|
|
2406
|
+
"vue/block-tag-newline": ["error", { multiline: "always", singleline: "always" }],
|
|
2407
|
+
"vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
|
|
2408
|
+
"vue/comma-dangle": ["error", "always-multiline"],
|
|
2409
|
+
"vue/comma-spacing": ["error", { after: true, before: false }],
|
|
2410
|
+
"vue/comma-style": ["error", "last"],
|
|
2411
|
+
"vue/html-indent": ["error", indent === "tab" ? "tab" : indent],
|
|
2412
|
+
"vue/html-quotes": ["error", "double"],
|
|
2413
|
+
"vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
|
|
2414
|
+
"vue/keyword-spacing": ["error", { after: true, before: true }],
|
|
2415
|
+
"vue/max-attributes-per-line": "off",
|
|
2416
|
+
"vue/object-curly-newline": "off",
|
|
2417
|
+
"vue/object-curly-spacing": ["error", "always"],
|
|
2418
|
+
"vue/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
|
|
2419
|
+
"vue/operator-linebreak": ["error", "before"],
|
|
2420
|
+
"vue/padding-line-between-blocks": ["error", "always"],
|
|
2421
|
+
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
2422
|
+
"vue/space-in-parens": ["error", "never"],
|
|
2423
|
+
"vue/template-curly-spacing": "error"
|
|
2424
|
+
} : {},
|
|
2289
2425
|
// User overrides
|
|
2290
2426
|
...overrides
|
|
2291
2427
|
}
|
|
@@ -2311,9 +2447,7 @@ async function vue(options = {}) {
|
|
|
2311
2447
|
"vuejs-accessibility/label-has-for": "error",
|
|
2312
2448
|
"vuejs-accessibility/no-autofocus": "warn",
|
|
2313
2449
|
"vuejs-accessibility/no-redundant-roles": "error",
|
|
2314
|
-
"vuejs-accessibility/tabindex-no-positive": "error"
|
|
2315
|
-
// User overrides
|
|
2316
|
-
...overrides
|
|
2450
|
+
"vuejs-accessibility/tabindex-no-positive": "error"
|
|
2317
2451
|
}
|
|
2318
2452
|
});
|
|
2319
2453
|
}
|
|
@@ -2378,37 +2512,49 @@ import ymlPlugin, { configs as ymlConfigs } from "eslint-plugin-yml";
|
|
|
2378
2512
|
import yamlParser from "yaml-eslint-parser";
|
|
2379
2513
|
var ymlStandardRules = ymlConfigs?.standard?.rules || {};
|
|
2380
2514
|
function yaml(options = {}) {
|
|
2381
|
-
const {
|
|
2515
|
+
const {
|
|
2516
|
+
overrides = {},
|
|
2517
|
+
stylistic: stylistic2 = true
|
|
2518
|
+
} = options;
|
|
2519
|
+
const {
|
|
2520
|
+
indent = 2,
|
|
2521
|
+
quotes = "single"
|
|
2522
|
+
} = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
2382
2523
|
return [
|
|
2383
2524
|
{
|
|
2384
2525
|
files: [GLOB_YAML],
|
|
2385
2526
|
languageOptions: {
|
|
2386
2527
|
parser: yamlParser
|
|
2387
2528
|
},
|
|
2388
|
-
name: "eslint-sets/yaml
|
|
2529
|
+
name: "eslint-sets/yaml",
|
|
2389
2530
|
plugins: {
|
|
2390
2531
|
yml: ymlPlugin
|
|
2391
2532
|
},
|
|
2392
2533
|
rules: {
|
|
2393
2534
|
...ymlStandardRules,
|
|
2394
|
-
// YAML rules
|
|
2535
|
+
// YAML core rules (always enabled)
|
|
2395
2536
|
"yml/block-mapping": "error",
|
|
2396
2537
|
"yml/block-sequence": "error",
|
|
2397
2538
|
"yml/file-extension": ["error", { extension: "yml" }],
|
|
2398
2539
|
"yml/key-name-casing": "off",
|
|
2399
|
-
"yml/key-spacing": "error",
|
|
2400
2540
|
"yml/no-empty-document": "error",
|
|
2401
2541
|
"yml/no-empty-key": "error",
|
|
2402
2542
|
"yml/no-empty-mapping-value": "error",
|
|
2403
2543
|
"yml/no-empty-sequence-entry": "error",
|
|
2404
2544
|
"yml/no-irregular-whitespace": "error",
|
|
2405
|
-
"yml/no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
2406
|
-
"yml/no-tab-indent": "error",
|
|
2407
2545
|
"yml/plain-scalar": "error",
|
|
2408
2546
|
"yml/require-string-key": "error",
|
|
2409
2547
|
"yml/sort-keys": "off",
|
|
2410
2548
|
"yml/sort-sequence-values": "off",
|
|
2411
|
-
|
|
2549
|
+
// Stylistic rules (conditional)
|
|
2550
|
+
...stylistic2 ? {
|
|
2551
|
+
"yml/indent": ["error", indent === "tab" ? "tab" : indent],
|
|
2552
|
+
"yml/key-spacing": "error",
|
|
2553
|
+
"yml/no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
2554
|
+
"yml/no-tab-indent": indent === "tab" ? "off" : "error",
|
|
2555
|
+
"yml/quotes": ["error", { avoidEscape: true, prefer: quotes }],
|
|
2556
|
+
"yml/spaced-comment": "error"
|
|
2557
|
+
} : {},
|
|
2412
2558
|
// User overrides
|
|
2413
2559
|
...overrides
|
|
2414
2560
|
}
|
|
@@ -2495,12 +2641,16 @@ async function config(options = {}) {
|
|
|
2495
2641
|
if (isEnabled(tsOption) || isAutoDetect(tsOption) && autoDetect && hasTypeScript()) {
|
|
2496
2642
|
const tsOpts = isOptionsObject(tsOption) ? { ...tsOption } : {};
|
|
2497
2643
|
tsOpts.overrides = getOverrides(options, "typescript");
|
|
2644
|
+
tsOpts.type = _type;
|
|
2498
2645
|
configs.push(...await typescript(tsOpts));
|
|
2499
2646
|
}
|
|
2500
2647
|
if (isEnabled(vueOption) || isAutoDetect(vueOption) && autoDetect && hasVue()) {
|
|
2501
2648
|
const vueOpts = isOptionsObject(vueOption) ? { ...vueOption } : {};
|
|
2502
2649
|
vueOpts.overrides = getOverrides(options, "vue");
|
|
2503
|
-
|
|
2650
|
+
const vueStylistic = stylisticOption === false ? false : {
|
|
2651
|
+
indent: typeof stylisticOption === "object" ? stylisticOption.indent : 2
|
|
2652
|
+
};
|
|
2653
|
+
configs.push(...await vue({ ...vueOpts, stylistic: vueStylistic }));
|
|
2504
2654
|
}
|
|
2505
2655
|
if (isEnabled(reactOption) || isAutoDetect(reactOption) && autoDetect && hasReact()) {
|
|
2506
2656
|
const reactOpts = isOptionsObject(reactOption) ? { ...reactOption } : {};
|
|
@@ -2533,18 +2683,29 @@ async function config(options = {}) {
|
|
|
2533
2683
|
}
|
|
2534
2684
|
if (jsoncOption !== false) {
|
|
2535
2685
|
const jsoncOpts = typeof jsoncOption === "object" ? jsoncOption : {};
|
|
2536
|
-
|
|
2686
|
+
const jsoncStylistic = stylisticOption === false ? false : {
|
|
2687
|
+
indent: typeof stylisticOption === "object" ? stylisticOption.indent : 2
|
|
2688
|
+
};
|
|
2689
|
+
configs.push(...jsonc({ ...jsoncOpts, stylistic: jsoncStylistic }));
|
|
2537
2690
|
}
|
|
2538
2691
|
if (yamlOption !== false) {
|
|
2539
2692
|
const yamlOpts = typeof yamlOption === "object" ? yamlOption : {};
|
|
2540
|
-
|
|
2693
|
+
const yamlStylistic = stylisticOption === false ? false : {
|
|
2694
|
+
indent: typeof stylisticOption === "object" ? stylisticOption.indent : 2,
|
|
2695
|
+
quotes: typeof stylisticOption === "object" ? stylisticOption.quotes : "single"
|
|
2696
|
+
};
|
|
2697
|
+
configs.push(...yaml({ ...yamlOpts, stylistic: yamlStylistic }));
|
|
2541
2698
|
}
|
|
2542
2699
|
if (markdownOption !== false) {
|
|
2543
2700
|
const markdownOpts = typeof markdownOption === "object" ? markdownOption : {};
|
|
2544
2701
|
configs.push(...await markdown(markdownOpts));
|
|
2545
2702
|
}
|
|
2546
2703
|
if (tomlOption !== false) {
|
|
2547
|
-
|
|
2704
|
+
const tomlOpts = typeof tomlOption === "object" ? tomlOption : {};
|
|
2705
|
+
const tomlStylistic = stylisticOption === false ? false : {
|
|
2706
|
+
indent: typeof stylisticOption === "object" ? stylisticOption.indent : 2
|
|
2707
|
+
};
|
|
2708
|
+
configs.push(...toml({ ...tomlOpts, stylistic: tomlStylistic }));
|
|
2548
2709
|
}
|
|
2549
2710
|
if (importsOption !== false) {
|
|
2550
2711
|
const importsOpts = typeof importsOption === "object" ? importsOption : {};
|
package/dist/types.d.ts
CHANGED
|
@@ -33,12 +33,97 @@ export type FrameworkOptions = boolean | 'auto' | OptionsOverrides;
|
|
|
33
33
|
* Project type
|
|
34
34
|
*/
|
|
35
35
|
export type ProjectType = 'app' | 'lib';
|
|
36
|
+
/**
|
|
37
|
+
* Project type options
|
|
38
|
+
*/
|
|
39
|
+
export interface OptionsProjectType {
|
|
40
|
+
/**
|
|
41
|
+
* Type of the project. `lib` will enable more strict rules for libraries.
|
|
42
|
+
* @default 'app'
|
|
43
|
+
*/
|
|
44
|
+
type?: ProjectType;
|
|
45
|
+
}
|
|
36
46
|
/**
|
|
37
47
|
* Override rules for a specific configuration
|
|
38
48
|
*/
|
|
39
49
|
export interface OptionsOverrides {
|
|
40
50
|
overrides?: TypedFlatConfigItem['rules'];
|
|
41
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Editor environment detection options
|
|
54
|
+
*/
|
|
55
|
+
export interface OptionsIsInEditor {
|
|
56
|
+
/**
|
|
57
|
+
* Control to disable some rules in editors.
|
|
58
|
+
* @default auto-detect based on process.env
|
|
59
|
+
*/
|
|
60
|
+
isInEditor?: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Base stylistic options shared across configs
|
|
64
|
+
*/
|
|
65
|
+
export interface StylisticConfigBase {
|
|
66
|
+
/**
|
|
67
|
+
* Indentation style
|
|
68
|
+
* @default 2
|
|
69
|
+
*/
|
|
70
|
+
indent?: number | 'tab';
|
|
71
|
+
/**
|
|
72
|
+
* Quote style
|
|
73
|
+
* @default 'single'
|
|
74
|
+
*/
|
|
75
|
+
quotes?: 'single' | 'double';
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Stylistic options for configs that support it
|
|
79
|
+
*/
|
|
80
|
+
export interface OptionsStylistic {
|
|
81
|
+
stylistic?: boolean | StylisticConfigBase;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* TypeScript type-aware options
|
|
85
|
+
*/
|
|
86
|
+
export interface OptionsTypeScriptWithTypes {
|
|
87
|
+
/**
|
|
88
|
+
* When this options is provided, type aware rules will be enabled.
|
|
89
|
+
* @see https://typescript-eslint.io/linting/typed-linting/
|
|
90
|
+
*/
|
|
91
|
+
tsconfigPath?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Override type aware rules.
|
|
94
|
+
*/
|
|
95
|
+
overridesTypeAware?: TypedFlatConfigItem['rules'];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* TypeScript erasable syntax only options
|
|
99
|
+
*/
|
|
100
|
+
export interface OptionsTypeScriptErasableOnly {
|
|
101
|
+
/**
|
|
102
|
+
* Enable erasable syntax only rules.
|
|
103
|
+
* Useful for libraries that want to ensure type-only constructs.
|
|
104
|
+
* @default false
|
|
105
|
+
*/
|
|
106
|
+
erasableOnly?: boolean;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* TypeScript parser options
|
|
110
|
+
*/
|
|
111
|
+
export interface OptionsTypeScriptParserOptions {
|
|
112
|
+
/**
|
|
113
|
+
* Additional parser options for TypeScript.
|
|
114
|
+
*/
|
|
115
|
+
parserOptions?: Record<string, unknown>;
|
|
116
|
+
/**
|
|
117
|
+
* Glob patterns for files that should be type aware.
|
|
118
|
+
* @default ['**\/*.{ts,tsx}']
|
|
119
|
+
*/
|
|
120
|
+
filesTypeAware?: string[];
|
|
121
|
+
/**
|
|
122
|
+
* Glob patterns for files that should not be type aware.
|
|
123
|
+
* @default ['**\/*.md\/**', '**\/*.astro/*.ts']
|
|
124
|
+
*/
|
|
125
|
+
ignoresTypeAware?: string[];
|
|
126
|
+
}
|
|
42
127
|
/**
|
|
43
128
|
* Perfectionist sorting options
|
|
44
129
|
*/
|
|
@@ -61,7 +146,7 @@ export interface PerfectionistOptions {
|
|
|
61
146
|
/**
|
|
62
147
|
* Main configuration options
|
|
63
148
|
*/
|
|
64
|
-
export interface Options {
|
|
149
|
+
export interface Options extends OptionsIsInEditor {
|
|
65
150
|
/**
|
|
66
151
|
* Enable Angular support
|
|
67
152
|
* Requires @angular-eslint/eslint-plugin
|
|
@@ -125,11 +210,6 @@ export interface Options {
|
|
|
125
210
|
* @default true
|
|
126
211
|
*/
|
|
127
212
|
imports?: boolean | OptionsOverrides;
|
|
128
|
-
/**
|
|
129
|
-
* Control to disable some rules in editors
|
|
130
|
-
* @default auto-detect based on process.env
|
|
131
|
-
*/
|
|
132
|
-
isInEditor?: boolean;
|
|
133
213
|
/**
|
|
134
214
|
* Enable JSON/YAML support
|
|
135
215
|
* @default true
|
|
@@ -230,7 +310,7 @@ export interface Options {
|
|
|
230
310
|
* Enable TOML support
|
|
231
311
|
* @default true
|
|
232
312
|
*/
|
|
233
|
-
toml?: boolean;
|
|
313
|
+
toml?: boolean | OptionsOverrides;
|
|
234
314
|
/**
|
|
235
315
|
* Project type
|
|
236
316
|
* - 'app': Application project (default)
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEzD,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,CAAA;AAExC;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,WAAW,CAAA;AAEnF;;;;GAIG;AACH,MAAM,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H,IAAI,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAA;IAEjC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAA;IAEjC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAA;IAElB;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,GAAG,iBAAiB,CAAA;IAEjD;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAA;IAEpC;;;;OAIG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAA;IAEzB;;;OAGG;IACH,GAAG,CAAC,EAAE,gBAAgB,GAAG,UAAU,CAAA;IAEnC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAA;CACjC;AAED,YAAY,EAAE,MAAM,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-sets/eslint-config",
|
|
3
3
|
"description": "Modern ESLint config with flat config support for Vue, React, Svelte, TypeScript, Next.js, Nuxt, Astro, Angular, UnoCSS and more",
|
|
4
|
-
"version": "6.2.0-beta.
|
|
4
|
+
"version": "6.2.0-beta.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@9.0.6",
|
|
7
7
|
"bin": {
|
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
"@unocss/eslint-plugin": ">=0.60.0",
|
|
109
109
|
"astro-eslint-parser": "^1.0.2",
|
|
110
110
|
"eslint-plugin-astro": "^1.2.0",
|
|
111
|
+
"eslint-plugin-erasable-syntax-only": "^0.4.0",
|
|
111
112
|
"eslint-plugin-format": "^0.1.3",
|
|
112
113
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
113
114
|
"eslint-plugin-pnpm": "^1.1.0",
|