@w5s/eslint-config 3.2.1 → 3.3.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 CHANGED
@@ -1723,6 +1723,8 @@ type JsdocTypeFormatting = []|[{
1723
1723
 
1724
1724
  objectFieldSeparatorTrailingPunctuation?: boolean
1725
1725
 
1726
+ objectTypeBracketSpacing?: string
1727
+
1726
1728
  parameterDefaultValueSpacing?: string
1727
1729
 
1728
1730
  postMethodNameSpacing?: string
@@ -1733,6 +1735,8 @@ type JsdocTypeFormatting = []|[{
1733
1735
 
1734
1736
  stringQuotes?: ("double" | "single")
1735
1737
 
1738
+ trailingPunctuationMultilineOnly?: boolean
1739
+
1736
1740
  typeBracketSpacing?: string
1737
1741
 
1738
1742
  unionSpacing?: string
@@ -2432,6 +2436,11 @@ interface RuleOptions$5 {
2432
2436
  * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/console.md
2433
2437
  */
2434
2438
  'node/prefer-global/console'?: Linter.RuleEntry<NodePreferGlobalConsole>
2439
+ /**
2440
+ * enforce either `crypto` or `require("crypto").webcrypto`
2441
+ * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/crypto.md
2442
+ */
2443
+ 'node/prefer-global/crypto'?: Linter.RuleEntry<NodePreferGlobalCrypto>
2435
2444
  /**
2436
2445
  * enforce either `process` or `require("process")`
2437
2446
  * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/process.md
@@ -2447,6 +2456,11 @@ interface RuleOptions$5 {
2447
2456
  * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/text-encoder.md
2448
2457
  */
2449
2458
  'node/prefer-global/text-encoder'?: Linter.RuleEntry<NodePreferGlobalTextEncoder>
2459
+ /**
2460
+ * enforce either global timer functions or `require("timers")`
2461
+ * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/timers.md
2462
+ */
2463
+ 'node/prefer-global/timers'?: Linter.RuleEntry<NodePreferGlobalTimers>
2450
2464
  /**
2451
2465
  * enforce either `URL` or `require("url").URL`
2452
2466
  * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/url.md
@@ -2755,12 +2769,16 @@ type NodeNoUnsupportedFeaturesNodeBuiltins = []|[{
2755
2769
  type NodePreferGlobalBuffer = []|[("always" | "never")]
2756
2770
  // ----- node/prefer-global/console -----
2757
2771
  type NodePreferGlobalConsole = []|[("always" | "never")]
2772
+ // ----- node/prefer-global/crypto -----
2773
+ type NodePreferGlobalCrypto = []|[("always" | "never")]
2758
2774
  // ----- node/prefer-global/process -----
2759
2775
  type NodePreferGlobalProcess = []|[("always" | "never")]
2760
2776
  // ----- node/prefer-global/text-decoder -----
2761
2777
  type NodePreferGlobalTextDecoder = []|[("always" | "never")]
2762
2778
  // ----- node/prefer-global/text-encoder -----
2763
2779
  type NodePreferGlobalTextEncoder = []|[("always" | "never")]
2780
+ // ----- node/prefer-global/timers -----
2781
+ type NodePreferGlobalTimers = []|[("always" | "never")]
2764
2782
  // ----- node/prefer-global/url -----
2765
2783
  type NodePreferGlobalUrl = []|[("always" | "never")]
2766
2784
  // ----- node/prefer-global/url-search-params -----
@@ -2882,6 +2900,11 @@ interface RuleOptions$4 {
2882
2900
  * @see https://eslint.style/rules/eol-last
2883
2901
  */
2884
2902
  'style/eol-last'?: Linter.RuleEntry<StyleEolLast>
2903
+ /**
2904
+ * Enforce consistent line break styles for JSX props
2905
+ * @see https://eslint.style/rules/jsx-props-style
2906
+ */
2907
+ 'style/exp-jsx-props-style'?: Linter.RuleEntry<StyleExpJsxPropsStyle>
2885
2908
  /**
2886
2909
  * Enforce consistent spacing and line break styles inside brackets.
2887
2910
  * @see https://eslint.style/rules/list-style
@@ -3479,15 +3502,25 @@ type StyleCurlyNewline = []|[(("always" | "never") | {
3479
3502
  type StyleDotLocation = []|[("object" | "property")]
3480
3503
  // ----- style/eol-last -----
3481
3504
  type StyleEolLast = []|[("always" | "never" | "unix" | "windows")]
3505
+ // ----- style/exp-jsx-props-style -----
3506
+ type StyleExpJsxPropsStyle = []|[{
3507
+ singleLine?: {
3508
+ maxItems?: number
3509
+ }
3510
+ multiLine?: {
3511
+ minItems?: number
3512
+ maxItemsPerLine?: number
3513
+ }
3514
+ }]
3482
3515
  // ----- style/exp-list-style -----
3483
3516
  type StyleExpListStyle = []|[{
3484
3517
  singleLine?: _StyleExpListStyle_SingleLineConfig
3485
3518
  multiLine?: _StyleExpListStyle_MultiLineConfig
3486
3519
  overrides?: {
3520
+ "()"?: _StyleExpListStyle_BaseConfig
3487
3521
  "[]"?: _StyleExpListStyle_BaseConfig
3488
3522
  "{}"?: _StyleExpListStyle_BaseConfig
3489
3523
  "<>"?: _StyleExpListStyle_BaseConfig
3490
- "()"?: _StyleExpListStyle_BaseConfig
3491
3524
  ArrayExpression?: _StyleExpListStyle_BaseConfig
3492
3525
  ArrayPattern?: _StyleExpListStyle_BaseConfig
3493
3526
  ArrowFunctionExpression?: _StyleExpListStyle_BaseConfig
@@ -3495,21 +3528,22 @@ type StyleExpListStyle = []|[{
3495
3528
  ExportNamedDeclaration?: _StyleExpListStyle_BaseConfig
3496
3529
  FunctionDeclaration?: _StyleExpListStyle_BaseConfig
3497
3530
  FunctionExpression?: _StyleExpListStyle_BaseConfig
3498
- ImportDeclaration?: _StyleExpListStyle_BaseConfig
3531
+ IfStatement?: _StyleExpListStyle_BaseConfig
3499
3532
  ImportAttributes?: _StyleExpListStyle_BaseConfig
3533
+ ImportDeclaration?: _StyleExpListStyle_BaseConfig
3534
+ JSONArrayExpression?: _StyleExpListStyle_BaseConfig
3535
+ JSONObjectExpression?: _StyleExpListStyle_BaseConfig
3500
3536
  NewExpression?: _StyleExpListStyle_BaseConfig
3501
3537
  ObjectExpression?: _StyleExpListStyle_BaseConfig
3502
3538
  ObjectPattern?: _StyleExpListStyle_BaseConfig
3503
3539
  TSDeclareFunction?: _StyleExpListStyle_BaseConfig
3540
+ TSEnumBody?: _StyleExpListStyle_BaseConfig
3504
3541
  TSFunctionType?: _StyleExpListStyle_BaseConfig
3505
3542
  TSInterfaceBody?: _StyleExpListStyle_BaseConfig
3506
- TSEnumBody?: _StyleExpListStyle_BaseConfig
3507
3543
  TSTupleType?: _StyleExpListStyle_BaseConfig
3508
3544
  TSTypeLiteral?: _StyleExpListStyle_BaseConfig
3509
3545
  TSTypeParameterDeclaration?: _StyleExpListStyle_BaseConfig
3510
3546
  TSTypeParameterInstantiation?: _StyleExpListStyle_BaseConfig
3511
- JSONArrayExpression?: _StyleExpListStyle_BaseConfig
3512
- JSONObjectExpression?: _StyleExpListStyle_BaseConfig
3513
3547
  }
3514
3548
  }]
3515
3549
  interface _StyleExpListStyle_SingleLineConfig {
@@ -5571,7 +5605,7 @@ interface RuleOptions$2 {
5571
5605
  * Disallow default values that will never be used
5572
5606
  * @see https://typescript-eslint.io/rules/no-useless-default-assignment
5573
5607
  */
5574
- 'ts/no-useless-default-assignment'?: Linter.RuleEntry<[]>
5608
+ 'ts/no-useless-default-assignment'?: Linter.RuleEntry<TsNoUselessDefaultAssignment>
5575
5609
  /**
5576
5610
  * Disallow empty exports that don't change anything in a module file
5577
5611
  * @see https://typescript-eslint.io/rules/no-useless-empty-export
@@ -6678,6 +6712,11 @@ type TsNoUseBeforeDefine = []|[("nofunc" | {
6678
6712
 
6679
6713
  variables?: boolean
6680
6714
  })]
6715
+ // ----- ts/no-useless-default-assignment -----
6716
+ type TsNoUselessDefaultAssignment = []|[{
6717
+
6718
+ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean
6719
+ }]
6681
6720
  // ----- ts/no-var-requires -----
6682
6721
  type TsNoVarRequires = []|[{
6683
6722
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/eslint-config",
3
- "version": "3.2.1",
3
+ "version": "3.3.0",
4
4
  "description": "ESLint configuration presets",
5
5
  "keywords": [
6
6
  "eslint",
@@ -21,10 +21,6 @@
21
21
  "type": "module",
22
22
  "exports": {
23
23
  ".": {
24
- "require": {
25
- "types": "./dist/index.d.cts",
26
- "default": "./dist/index.cjs"
27
- },
28
24
  "import": {
29
25
  "types": "./dist/index.d.ts",
30
26
  "default": "./dist/index.js"
@@ -42,7 +38,24 @@
42
38
  "!**/__tests__/**"
43
39
  ],
44
40
  "scripts": {
45
- "postpack": "npx clean-package restore"
41
+ "build": "npx run-p \"build:*\"",
42
+ "build:tsc": "node --experimental-strip-types scripts/typegen.ts && tsup",
43
+ "clean": "npx run-p \"clean:*\"",
44
+ "clean:tsc": "rm -rf dist",
45
+ "docs": "node ../../markdown.mjs",
46
+ "format": "npx run-p \"format:*\"",
47
+ "format:src": "eslint . --fix",
48
+ "lint": "npx run-p \"lint:*\"",
49
+ "lint:src": "eslint .",
50
+ "postpack": "npx clean-package restore",
51
+ "prepack": "npx clean-package",
52
+ "prepare": "npx run-p \"prepare:*\"",
53
+ "prepare:empty": ":",
54
+ "prepublishOnly": "npm run clean;npm run build",
55
+ "spellcheck": "cspell --no-progress '**'",
56
+ "test": "npx run-p \"test:*\"",
57
+ "test:script": "scripts/test",
58
+ "test_:rule-coverage": "eslint-find-rules --unused"
46
59
  },
47
60
  "dependencies": {
48
61
  "@stylistic/eslint-plugin": "^5.0.0",
@@ -50,18 +63,30 @@
50
63
  "@typescript-eslint/parser": "^8.0.0",
51
64
  "@vitest/eslint-plugin": "^1.0.0",
52
65
  "@w5s/dev": "^3.1.2",
53
- "@w5s/prettier-config": "^3.0.3",
66
+ "@w5s/prettier-config": "^3.0.4",
54
67
  "eslint-plugin-import": "^2.25.0",
55
- "eslint-plugin-jsdoc": "^61.0.0",
68
+ "eslint-plugin-jsdoc": "^62.0.0",
56
69
  "eslint-plugin-jsonc": "^2.4.0",
57
70
  "eslint-plugin-n": "^17.0.0",
58
71
  "eslint-plugin-unicorn": "^62.0.0",
59
- "eslint-plugin-yml": "^1.1.0",
72
+ "eslint-plugin-yml": "^2.0.0",
60
73
  "find-up": "^8.0.0",
61
74
  "globals": "^17.0.0",
62
75
  "jsonc-eslint-parser": "^2.0.0",
63
76
  "parse-gitignore": "^2.0.0",
64
- "yaml-eslint-parser": "^1.0.0"
77
+ "yaml-eslint-parser": "^2.0.0"
78
+ },
79
+ "devDependencies": {
80
+ "@types/eslint": "9.6.1",
81
+ "@types/parse-gitignore": "1.0.2",
82
+ "@types/react": "19.2.14",
83
+ "@typescript-eslint/parser": "8.55.0",
84
+ "eslint": "9.39.2",
85
+ "eslint-find-rules": "5.0.0",
86
+ "eslint-typegen": "2.3.0",
87
+ "react": "19.2.4",
88
+ "vite": "7.3.1",
89
+ "vitest": "4.0.18"
65
90
  },
66
91
  "peerDependencies": {
67
92
  "eslint": "9.x",
@@ -75,6 +100,7 @@
75
100
  "optional": true
76
101
  }
77
102
  },
103
+ "clean-package": "../../clean-package.config.mjs",
78
104
  "engines": {
79
105
  "node": ">=20.0.0"
80
106
  },
@@ -82,5 +108,5 @@
82
108
  "access": "public"
83
109
  },
84
110
  "sideEffect": false,
85
- "gitHead": "648be101c2d4f915b97ed7e318da47a6ac19eb5c"
111
+ "gitHead": "1339ba15448ca7c3aea9f0afa0ece486f4693961"
86
112
  }
@@ -1156,6 +1156,8 @@ type JsdocTypeFormatting = []|[{
1156
1156
 
1157
1157
  objectFieldSeparatorTrailingPunctuation?: boolean
1158
1158
 
1159
+ objectTypeBracketSpacing?: string
1160
+
1159
1161
  parameterDefaultValueSpacing?: string
1160
1162
 
1161
1163
  postMethodNameSpacing?: string
@@ -1166,6 +1168,8 @@ type JsdocTypeFormatting = []|[{
1166
1168
 
1167
1169
  stringQuotes?: ("double" | "single")
1168
1170
 
1171
+ trailingPunctuationMultilineOnly?: boolean
1172
+
1169
1173
  typeBracketSpacing?: string
1170
1174
 
1171
1175
  unionSpacing?: string
@@ -165,6 +165,11 @@ export interface RuleOptions {
165
165
  * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/console.md
166
166
  */
167
167
  'node/prefer-global/console'?: Linter.RuleEntry<NodePreferGlobalConsole>
168
+ /**
169
+ * enforce either `crypto` or `require("crypto").webcrypto`
170
+ * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/crypto.md
171
+ */
172
+ 'node/prefer-global/crypto'?: Linter.RuleEntry<NodePreferGlobalCrypto>
168
173
  /**
169
174
  * enforce either `process` or `require("process")`
170
175
  * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/process.md
@@ -180,6 +185,11 @@ export interface RuleOptions {
180
185
  * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/text-encoder.md
181
186
  */
182
187
  'node/prefer-global/text-encoder'?: Linter.RuleEntry<NodePreferGlobalTextEncoder>
188
+ /**
189
+ * enforce either global timer functions or `require("timers")`
190
+ * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/timers.md
191
+ */
192
+ 'node/prefer-global/timers'?: Linter.RuleEntry<NodePreferGlobalTimers>
183
193
  /**
184
194
  * enforce either `URL` or `require("url").URL`
185
195
  * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/url.md
@@ -488,12 +498,16 @@ type NodeNoUnsupportedFeaturesNodeBuiltins = []|[{
488
498
  type NodePreferGlobalBuffer = []|[("always" | "never")]
489
499
  // ----- node/prefer-global/console -----
490
500
  type NodePreferGlobalConsole = []|[("always" | "never")]
501
+ // ----- node/prefer-global/crypto -----
502
+ type NodePreferGlobalCrypto = []|[("always" | "never")]
491
503
  // ----- node/prefer-global/process -----
492
504
  type NodePreferGlobalProcess = []|[("always" | "never")]
493
505
  // ----- node/prefer-global/text-decoder -----
494
506
  type NodePreferGlobalTextDecoder = []|[("always" | "never")]
495
507
  // ----- node/prefer-global/text-encoder -----
496
508
  type NodePreferGlobalTextEncoder = []|[("always" | "never")]
509
+ // ----- node/prefer-global/timers -----
510
+ type NodePreferGlobalTimers = []|[("always" | "never")]
497
511
  // ----- node/prefer-global/url -----
498
512
  type NodePreferGlobalUrl = []|[("always" | "never")]
499
513
  // ----- node/prefer-global/url-search-params -----
@@ -79,6 +79,11 @@ export interface RuleOptions {
79
79
  * @see https://eslint.style/rules/eol-last
80
80
  */
81
81
  'style/eol-last'?: Linter.RuleEntry<StyleEolLast>
82
+ /**
83
+ * Enforce consistent line break styles for JSX props
84
+ * @see https://eslint.style/rules/jsx-props-style
85
+ */
86
+ 'style/exp-jsx-props-style'?: Linter.RuleEntry<StyleExpJsxPropsStyle>
82
87
  /**
83
88
  * Enforce consistent spacing and line break styles inside brackets.
84
89
  * @see https://eslint.style/rules/list-style
@@ -676,15 +681,25 @@ type StyleCurlyNewline = []|[(("always" | "never") | {
676
681
  type StyleDotLocation = []|[("object" | "property")]
677
682
  // ----- style/eol-last -----
678
683
  type StyleEolLast = []|[("always" | "never" | "unix" | "windows")]
684
+ // ----- style/exp-jsx-props-style -----
685
+ type StyleExpJsxPropsStyle = []|[{
686
+ singleLine?: {
687
+ maxItems?: number
688
+ }
689
+ multiLine?: {
690
+ minItems?: number
691
+ maxItemsPerLine?: number
692
+ }
693
+ }]
679
694
  // ----- style/exp-list-style -----
680
695
  type StyleExpListStyle = []|[{
681
696
  singleLine?: _StyleExpListStyle_SingleLineConfig
682
697
  multiLine?: _StyleExpListStyle_MultiLineConfig
683
698
  overrides?: {
699
+ "()"?: _StyleExpListStyle_BaseConfig
684
700
  "[]"?: _StyleExpListStyle_BaseConfig
685
701
  "{}"?: _StyleExpListStyle_BaseConfig
686
702
  "<>"?: _StyleExpListStyle_BaseConfig
687
- "()"?: _StyleExpListStyle_BaseConfig
688
703
  ArrayExpression?: _StyleExpListStyle_BaseConfig
689
704
  ArrayPattern?: _StyleExpListStyle_BaseConfig
690
705
  ArrowFunctionExpression?: _StyleExpListStyle_BaseConfig
@@ -692,21 +707,22 @@ type StyleExpListStyle = []|[{
692
707
  ExportNamedDeclaration?: _StyleExpListStyle_BaseConfig
693
708
  FunctionDeclaration?: _StyleExpListStyle_BaseConfig
694
709
  FunctionExpression?: _StyleExpListStyle_BaseConfig
695
- ImportDeclaration?: _StyleExpListStyle_BaseConfig
710
+ IfStatement?: _StyleExpListStyle_BaseConfig
696
711
  ImportAttributes?: _StyleExpListStyle_BaseConfig
712
+ ImportDeclaration?: _StyleExpListStyle_BaseConfig
713
+ JSONArrayExpression?: _StyleExpListStyle_BaseConfig
714
+ JSONObjectExpression?: _StyleExpListStyle_BaseConfig
697
715
  NewExpression?: _StyleExpListStyle_BaseConfig
698
716
  ObjectExpression?: _StyleExpListStyle_BaseConfig
699
717
  ObjectPattern?: _StyleExpListStyle_BaseConfig
700
718
  TSDeclareFunction?: _StyleExpListStyle_BaseConfig
719
+ TSEnumBody?: _StyleExpListStyle_BaseConfig
701
720
  TSFunctionType?: _StyleExpListStyle_BaseConfig
702
721
  TSInterfaceBody?: _StyleExpListStyle_BaseConfig
703
- TSEnumBody?: _StyleExpListStyle_BaseConfig
704
722
  TSTupleType?: _StyleExpListStyle_BaseConfig
705
723
  TSTypeLiteral?: _StyleExpListStyle_BaseConfig
706
724
  TSTypeParameterDeclaration?: _StyleExpListStyle_BaseConfig
707
725
  TSTypeParameterInstantiation?: _StyleExpListStyle_BaseConfig
708
- JSONArrayExpression?: _StyleExpListStyle_BaseConfig
709
- JSONObjectExpression?: _StyleExpListStyle_BaseConfig
710
726
  }
711
727
  }]
712
728
  interface _StyleExpListStyle_SingleLineConfig {
@@ -476,7 +476,7 @@ export interface RuleOptions {
476
476
  * Disallow default values that will never be used
477
477
  * @see https://typescript-eslint.io/rules/no-useless-default-assignment
478
478
  */
479
- 'ts/no-useless-default-assignment'?: Linter.RuleEntry<[]>
479
+ 'ts/no-useless-default-assignment'?: Linter.RuleEntry<TsNoUselessDefaultAssignment>
480
480
  /**
481
481
  * Disallow empty exports that don't change anything in a module file
482
482
  * @see https://typescript-eslint.io/rules/no-useless-empty-export
@@ -1583,6 +1583,11 @@ type TsNoUseBeforeDefine = []|[("nofunc" | {
1583
1583
 
1584
1584
  variables?: boolean
1585
1585
  })]
1586
+ // ----- ts/no-useless-default-assignment -----
1587
+ type TsNoUselessDefaultAssignment = []|[{
1588
+
1589
+ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean
1590
+ }]
1586
1591
  // ----- ts/no-var-requires -----
1587
1592
  type TsNoVarRequires = []|[{
1588
1593