@kitschpatrol/eslint-config 5.7.2 → 5.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/cli.js CHANGED
@@ -5138,7 +5138,7 @@ var Yargs = YargsFactory(esm_default);
5138
5138
  var yargs_default = Yargs;
5139
5139
 
5140
5140
  // ../../package.json
5141
- var version = "5.7.2";
5141
+ var version = "5.7.4";
5142
5142
 
5143
5143
  // ../../src/execa-utilities.ts
5144
5144
  function isErrorExecaError(error) {
package/dist/index.d.ts CHANGED
@@ -1451,6 +1451,26 @@ interface RuleOptions {
1451
1451
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/text-escaping.md#repos-sticky-header
1452
1452
  */
1453
1453
  'jsdoc/text-escaping'?: Linter.RuleEntry<JsdocTextEscaping>
1454
+ /**
1455
+ * Prefers either function properties or method signatures
1456
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-method-signature-style.md#repos-sticky-header
1457
+ */
1458
+ 'jsdoc/ts-method-signature-style'?: Linter.RuleEntry<JsdocTsMethodSignatureStyle>
1459
+ /**
1460
+ * Warns against use of the empty object type
1461
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-no-empty-object-type.md#repos-sticky-header
1462
+ */
1463
+ 'jsdoc/ts-no-empty-object-type'?: Linter.RuleEntry<[]>
1464
+ /**
1465
+ * Catches unnecessary template expressions such as string expressions within a template literal.
1466
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-no-unnecessary-template-expression.md#repos-sticky-header
1467
+ */
1468
+ 'jsdoc/ts-no-unnecessary-template-expression'?: Linter.RuleEntry<JsdocTsNoUnnecessaryTemplateExpression>
1469
+ /**
1470
+ * Prefers function types over call signatures when there are no other properties.
1471
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-prefer-function-type.md#repos-sticky-header
1472
+ */
1473
+ 'jsdoc/ts-prefer-function-type'?: Linter.RuleEntry<JsdocTsPreferFunctionType>
1454
1474
  /**
1455
1475
  * Formats JSDoc type values.
1456
1476
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/type-formatting.md#repos-sticky-header
@@ -4912,7 +4932,7 @@ interface RuleOptions {
4912
4932
  */
4913
4933
  'template-tag-spacing'?: Linter.RuleEntry<TemplateTagSpacing>
4914
4934
  /**
4915
- * require .spec test file pattern
4935
+ * require test file pattern
4916
4936
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
4917
4937
  */
4918
4938
  'test/consistent-test-filename'?: Linter.RuleEntry<TestConsistentTestFilename>
@@ -9414,6 +9434,32 @@ type JsdocTextEscaping =
9414
9434
  escapeMarkdown?: boolean
9415
9435
  },
9416
9436
  ]
9437
+ // ----- jsdoc/ts-method-signature-style -----
9438
+ type JsdocTsMethodSignatureStyle =
9439
+ | []
9440
+ | ['method' | 'property']
9441
+ | [
9442
+ 'method' | 'property',
9443
+ {
9444
+ enableFixer?: boolean
9445
+ },
9446
+ ]
9447
+ // ----- jsdoc/ts-no-unnecessary-template-expression -----
9448
+ type JsdocTsNoUnnecessaryTemplateExpression =
9449
+ | []
9450
+ | [
9451
+ {
9452
+ enableFixer?: boolean
9453
+ },
9454
+ ]
9455
+ // ----- jsdoc/ts-prefer-function-type -----
9456
+ type JsdocTsPreferFunctionType =
9457
+ | []
9458
+ | [
9459
+ {
9460
+ enableFixer?: boolean
9461
+ },
9462
+ ]
9417
9463
  // ----- jsdoc/type-formatting -----
9418
9464
  type JsdocTypeFormatting =
9419
9465
  | []
@@ -9421,10 +9467,36 @@ type JsdocTypeFormatting =
9421
9467
  {
9422
9468
  arrayBrackets?: 'angle' | 'square'
9423
9469
 
9470
+ arrowFunctionPostReturnMarkerSpacing?: string
9471
+
9472
+ arrowFunctionPreReturnMarkerSpacing?: string
9473
+
9424
9474
  enableFixer?: boolean
9425
9475
 
9476
+ functionOrClassParameterSpacing?: string
9477
+
9478
+ functionOrClassPostGenericSpacing?: string
9479
+
9480
+ functionOrClassPostReturnMarkerSpacing?: string
9481
+
9482
+ functionOrClassPreReturnMarkerSpacing?: string
9483
+
9484
+ functionOrClassTypeParameterSpacing?: string
9485
+
9486
+ genericAndTupleElementSpacing?: string
9487
+
9426
9488
  genericDot?: boolean
9427
9489
 
9490
+ keyValuePostColonSpacing?: string
9491
+
9492
+ keyValuePostKeySpacing?: string
9493
+
9494
+ keyValuePostOptionalSpacing?: string
9495
+
9496
+ keyValuePostVariadicSpacing?: string
9497
+
9498
+ methodQuotes?: 'double' | 'single'
9499
+
9428
9500
  objectFieldIndent?: string
9429
9501
 
9430
9502
  objectFieldQuote?: 'double' | 'single' | null
@@ -9440,6 +9512,12 @@ type JsdocTypeFormatting =
9440
9512
 
9441
9513
  objectFieldSeparatorTrailingPunctuation?: boolean
9442
9514
 
9515
+ parameterDefaultValueSpacing?: string
9516
+
9517
+ postMethodNameSpacing?: string
9518
+
9519
+ postNewSpacing?: string
9520
+
9443
9521
  separatorForSingleObjectField?: boolean
9444
9522
 
9445
9523
  stringQuotes?: 'double' | 'single'
@@ -19411,7 +19489,6 @@ type ReactNoForbiddenProps =
19411
19489
  prop: string
19412
19490
  }
19413
19491
  )[]
19414
- [k: string]: unknown | undefined
19415
19492
  },
19416
19493
  ]
19417
19494
  // ----- react/no-useless-fragment -----
package/dist/index.js CHANGED
@@ -602,6 +602,10 @@ var jsdocCommentsRecommendedTypescriptFlavorRules = {
602
602
  "jsdoc/sort-tags": "off",
603
603
  "jsdoc/tag-lines": "warn",
604
604
  "jsdoc/text-escaping": "off",
605
+ "jsdoc/ts-method-signature-style": "off",
606
+ "jsdoc/ts-no-empty-object-type": "warn",
607
+ "jsdoc/ts-no-unnecessary-template-expression": "off",
608
+ "jsdoc/ts-prefer-function-type": "off",
605
609
  "jsdoc/type-formatting": "off",
606
610
  "jsdoc/valid-types": "warn"
607
611
  // End expansion
@@ -676,6 +680,10 @@ var jsdocCommentsRecommendedTypescriptRules = {
676
680
  "jsdoc/sort-tags": "off",
677
681
  "jsdoc/tag-lines": "warn",
678
682
  "jsdoc/text-escaping": "off",
683
+ "jsdoc/ts-method-signature-style": "off",
684
+ "jsdoc/ts-no-empty-object-type": "warn",
685
+ "jsdoc/ts-no-unnecessary-template-expression": "off",
686
+ "jsdoc/ts-prefer-function-type": "off",
679
687
  "jsdoc/type-formatting": "off",
680
688
  "jsdoc/valid-types": "warn"
681
689
  // End expansion
@@ -1371,10 +1379,6 @@ var reactRecommendedTypeCheckedRules = {
1371
1379
  // Begin expansion '@eslint-react/eslint-plugin' 'recommended-type-checked'
1372
1380
  "react/jsx-no-comment-textnodes": "warn",
1373
1381
  "react/jsx-no-duplicate-props": "off",
1374
- "react/jsx-no-iife": "off",
1375
- "react/jsx-no-undef": "off",
1376
- "react/jsx-shorthand-boolean": "off",
1377
- "react/jsx-shorthand-fragment": "off",
1378
1382
  "react/jsx-uses-react": "off",
1379
1383
  "react/jsx-uses-vars": "off",
1380
1384
  "react/no-access-state-in-setstate": "error",
@@ -1383,9 +1387,7 @@ var reactRecommendedTypeCheckedRules = {
1383
1387
  "react/no-children-for-each": "warn",
1384
1388
  "react/no-children-map": "warn",
1385
1389
  "react/no-children-only": "warn",
1386
- "react/no-children-prop": "off",
1387
1390
  "react/no-children-to-array": "warn",
1388
- "react/no-class-component": "off",
1389
1391
  "react/no-clone-element": "warn",
1390
1392
  "react/no-component-will-mount": "error",
1391
1393
  "react/no-component-will-receive-props": "error",
@@ -1395,14 +1397,9 @@ var reactRecommendedTypeCheckedRules = {
1395
1397
  "react/no-default-props": "error",
1396
1398
  "react/no-direct-mutation-state": "error",
1397
1399
  "react/no-duplicate-key": "error",
1398
- "react/no-forbidden-props": "off",
1399
1400
  "react/no-forward-ref": "warn",
1400
1401
  "react/no-implicit-key": "warn",
1401
- "react/no-leaked-conditional-rendering": "warn",
1402
- "react/no-missing-component-display-name": "off",
1403
- "react/no-missing-context-display-name": "off",
1404
1402
  "react/no-missing-key": "error",
1405
- "react/no-misused-capture-owner-stack": "off",
1406
1403
  "react/no-nested-component-definitions": "error",
1407
1404
  "react/no-nested-lazy-component-declarations": "error",
1408
1405
  "react/no-prop-types": "error",
@@ -1411,38 +1408,24 @@ var reactRecommendedTypeCheckedRules = {
1411
1408
  "react/no-set-state-in-component-did-update": "warn",
1412
1409
  "react/no-set-state-in-component-will-update": "warn",
1413
1410
  "react/no-string-refs": "error",
1414
- "react/no-unnecessary-key": "off",
1415
- "react/no-unnecessary-use-callback": "off",
1416
- "react/no-unnecessary-use-memo": "off",
1417
1411
  "react/no-unnecessary-use-prefix": "warn",
1418
1412
  "react/no-unsafe-component-will-mount": "warn",
1419
1413
  "react/no-unsafe-component-will-receive-props": "warn",
1420
1414
  "react/no-unsafe-component-will-update": "warn",
1421
- "react/no-unstable-context-value": "warn",
1422
- "react/no-unstable-default-props": "warn",
1423
1415
  "react/no-unused-class-component-members": "warn",
1424
- "react/no-unused-props": "warn",
1425
- "react/no-unused-state": "warn",
1426
1416
  "react/no-use-context": "warn",
1427
1417
  "react/no-useless-forward-ref": "warn",
1428
- "react/no-useless-fragment": "off",
1429
- "react/prefer-destructuring-assignment": "off",
1430
- "react/prefer-namespace-import": "off",
1431
- "react/prefer-read-only-props": "off",
1432
1418
  "react/prefer-use-state-lazy-initialization": "warn",
1433
1419
  "react-dom/no-dangerously-set-innerhtml": "warn",
1434
1420
  "react-dom/no-dangerously-set-innerhtml-with-children": "error",
1435
1421
  "react-dom/no-find-dom-node": "error",
1436
1422
  "react-dom/no-flush-sync": "error",
1437
1423
  "react-dom/no-hydrate": "error",
1438
- "react-dom/no-missing-button-type": "warn",
1439
- "react-dom/no-missing-iframe-sandbox": "warn",
1440
1424
  "react-dom/no-namespace": "error",
1441
1425
  "react-dom/no-render": "error",
1442
1426
  "react-dom/no-render-return-value": "error",
1443
1427
  "react-dom/no-script-url": "warn",
1444
1428
  "react-dom/no-unsafe-iframe-sandbox": "warn",
1445
- "react-dom/no-unsafe-target-blank": "warn",
1446
1429
  "react-dom/no-use-form-state": "error",
1447
1430
  "react-dom/no-void-elements-with-children": "error",
1448
1431
  "react-web-api/no-leaked-event-listener": "warn",
@@ -1453,7 +1436,9 @@ var reactRecommendedTypeCheckedRules = {
1453
1436
  "react-naming-convention/context-name": "warn",
1454
1437
  "react-naming-convention/use-state": "warn",
1455
1438
  "react-dom/no-string-style-prop": "off",
1456
- "react-dom/no-unknown-property": "off"
1439
+ "react-dom/no-unknown-property": "off",
1440
+ "react/jsx-no-undef": "off",
1441
+ "react/no-leaked-conditional-rendering": "error"
1457
1442
  // End expansion
1458
1443
  };
1459
1444
  var reactDisableTypeCheckedRules = {
@@ -2488,6 +2473,46 @@ var kpSharedDisableTypeCheckedRules = {
2488
2473
  "jsdoc/check-tag-names": ["error", { typed: false }],
2489
2474
  "jsdoc/no-types": "off"
2490
2475
  };
2476
+ var kpPerfectionistSortConfig = [
2477
+ // Note precedence sensitivity...
2478
+ // This has to come before the `min` rules to sort
2479
+ // strings like `{ minImageWidth: 1, minImageHeight: 1 }` correctly
2480
+ generatePerfectionistSortConfig(["width", "height"]),
2481
+ generatePerfectionistSortConfig(["width", "height"], "leading"),
2482
+ generatePerfectionistSortConfig(["Width", "Height"], "trailing"),
2483
+ generatePerfectionistSortConfig(["r", "g", "b"]),
2484
+ generatePerfectionistSortConfig(["R", "G", "B"], "trailing"),
2485
+ generatePerfectionistSortConfig(["red", "green", "blue"]),
2486
+ generatePerfectionistSortConfig(["Red", "Green", "Blue"], "trailing"),
2487
+ generatePerfectionistSortConfig(["h", "s", "l"]),
2488
+ generatePerfectionistSortConfig(["hue", "saturation", "lightness"]),
2489
+ generatePerfectionistSortConfig(["h", "s", "l", "a"]),
2490
+ generatePerfectionistSortConfig(["hue", "saturation", "lightness", "alpha"]),
2491
+ generatePerfectionistSortConfig(["h", "s", "v"]),
2492
+ generatePerfectionistSortConfig(["a", "b"]),
2493
+ // For partial matches...
2494
+ generatePerfectionistSortConfig(["r", "g", "b", "a"]),
2495
+ generatePerfectionistSortConfig(["red", "green", "blue", "alpha"]),
2496
+ generatePerfectionistSortConfig(["Red", "Green", "Blue", "Alpha"], "trailing"),
2497
+ generatePerfectionistSortConfig(["x", "y", "z", "w"]),
2498
+ generatePerfectionistSortConfig(["x", "y", "z", "w"], "leading"),
2499
+ generatePerfectionistSortConfig(["X", "Y", "Z", "W"], "trailing"),
2500
+ generatePerfectionistSortConfig(["x1", "y1", "x2", "y2"]),
2501
+ generatePerfectionistSortConfig(["x1", "y1", "x2", "y2"], "leading"),
2502
+ generatePerfectionistSortConfig(["X1", "Y1", "X2", "Y2"], "trailing"),
2503
+ generatePerfectionistSortConfig(["x1", "y1", "x2", "y2", "z1", "z2"]),
2504
+ generatePerfectionistSortConfig(["x1", "y1", "x2", "y2", "z1", "z2"], "leading"),
2505
+ generatePerfectionistSortConfig(["X1", "Y1", "X2", "Y2", "Z1", "Z2"], "trailing"),
2506
+ generatePerfectionistSortConfig(["open", "close"]),
2507
+ generatePerfectionistSortConfig(["open", "close"], "leading"),
2508
+ generatePerfectionistSortConfig(["Open", "Close"], "trailing"),
2509
+ generatePerfectionistSortConfig(["start", "end"]),
2510
+ generatePerfectionistSortConfig(["start", "end"], "leading"),
2511
+ generatePerfectionistSortConfig(["Start", "End"], "trailing"),
2512
+ generatePerfectionistSortConfig(["min", "max"]),
2513
+ generatePerfectionistSortConfig(["min", "max"], "leading"),
2514
+ generatePerfectionistSortConfig(["Min", "Max"], "trailing")
2515
+ ];
2491
2516
  var sharedScriptConfig = {
2492
2517
  plugins: {
2493
2518
  depend: pluginDepend,
@@ -2587,39 +2612,14 @@ var sharedScriptConfig = {
2587
2612
  ],
2588
2613
  // Too chaotic... but should revisit
2589
2614
  "perfectionist/sort-modules": "off",
2615
+ "perfectionist/sort-object-types": [
2616
+ "error",
2617
+ ...kpPerfectionistSortConfig,
2618
+ { newlinesBetween: "never", order: "asc", type: "natural" }
2619
+ ],
2590
2620
  "perfectionist/sort-objects": [
2591
2621
  "error",
2592
- // Note precedence sensitivity...
2593
- // This has to come before the `min` rules to sort
2594
- // strings like `{ minImageWidth: 1, minImageHeight: 1 }` correctly
2595
- generatePerfectionistSortConfig(["width", "height"]),
2596
- generatePerfectionistSortConfig(["width", "height"], "leading"),
2597
- generatePerfectionistSortConfig(["Width", "Height"], "trailing"),
2598
- generatePerfectionistSortConfig(["r", "g", "b"]),
2599
- generatePerfectionistSortConfig(["R", "G", "B"], "trailing"),
2600
- generatePerfectionistSortConfig(["red", "green", "blue"]),
2601
- generatePerfectionistSortConfig(["Red", "Green", "Blue"], "trailing"),
2602
- generatePerfectionistSortConfig(["h", "s", "l"]),
2603
- generatePerfectionistSortConfig(["hue", "saturation", "lightness"]),
2604
- generatePerfectionistSortConfig(["h", "s", "l", "a"]),
2605
- generatePerfectionistSortConfig(["hue", "saturation", "lightness", "alpha"]),
2606
- generatePerfectionistSortConfig(["h", "s", "v"]),
2607
- generatePerfectionistSortConfig(["a", "b"]),
2608
- // For partial matches...
2609
- generatePerfectionistSortConfig(["r", "g", "b", "a"]),
2610
- generatePerfectionistSortConfig(["red", "green", "blue", "alpha"]),
2611
- generatePerfectionistSortConfig(["Red", "Green", "Blue", "Alpha"], "trailing"),
2612
- generatePerfectionistSortConfig(["x", "y", "z", "w"]),
2613
- generatePerfectionistSortConfig(["X", "Y", "Z", "W"], "trailing"),
2614
- generatePerfectionistSortConfig(["open", "close"]),
2615
- generatePerfectionistSortConfig(["open", "close"], "leading"),
2616
- generatePerfectionistSortConfig(["Open", "Close"], "trailing"),
2617
- generatePerfectionistSortConfig(["start", "end"]),
2618
- generatePerfectionistSortConfig(["start", "end"], "leading"),
2619
- generatePerfectionistSortConfig(["Start", "End"], "trailing"),
2620
- generatePerfectionistSortConfig(["min", "max"]),
2621
- generatePerfectionistSortConfig(["min", "max"], "leading"),
2622
- generatePerfectionistSortConfig(["Min", "Max"], "trailing"),
2622
+ ...kpPerfectionistSortConfig,
2623
2623
  { newlinesBetween: "never", order: "asc", type: "natural" }
2624
2624
  ],
2625
2625
  "sort-imports": "off",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitschpatrol/eslint-config",
3
- "version": "5.7.2",
3
+ "version": "5.7.4",
4
4
  "description": "ESLint configuration for @kitschpatrol/shared-config.",
5
5
  "keywords": [
6
6
  "shared-config",
@@ -43,13 +43,13 @@
43
43
  ],
44
44
  "dependencies": {
45
45
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
46
- "@eslint-react/eslint-plugin": "^2.0.6",
46
+ "@eslint-react/eslint-plugin": "2.1.1",
47
47
  "@html-eslint/eslint-plugin": "^0.47.0",
48
48
  "@html-eslint/parser": "^0.47.0",
49
49
  "@pinojs/json-colorizer": "^4.0.0",
50
- "@typescript-eslint/eslint-plugin": "^8.46.0",
51
- "@typescript-eslint/parser": "^8.46.0",
52
- "@vitest/eslint-plugin": "^1.3.16",
50
+ "@typescript-eslint/eslint-plugin": "^8.46.1",
51
+ "@typescript-eslint/parser": "^8.46.1",
52
+ "@vitest/eslint-plugin": "^1.3.20",
53
53
  "astro-eslint-parser": "^1.2.2",
54
54
  "eslint": "^9.37.0",
55
55
  "eslint-config-flat-gitignore": "^2.1.0",
@@ -60,13 +60,13 @@
60
60
  "eslint-plugin-depend": "^1.3.1",
61
61
  "eslint-plugin-html": "^8.1.3",
62
62
  "eslint-plugin-import-x": "^4.16.1",
63
- "eslint-plugin-jsdoc": "^60.8.3",
63
+ "eslint-plugin-jsdoc": "^61.1.3",
64
64
  "eslint-plugin-jsonc": "^2.21.0",
65
65
  "eslint-plugin-jsx-a11y": "^6.10.2",
66
66
  "eslint-plugin-mdx": "^3.6.2",
67
67
  "eslint-plugin-n": "^17.23.1",
68
68
  "eslint-plugin-no-only-tests": "^3.3.0",
69
- "eslint-plugin-package-json": "^0.56.3",
69
+ "eslint-plugin-package-json": "^0.56.4",
70
70
  "eslint-plugin-perfectionist": "^4.15.1",
71
71
  "eslint-plugin-regexp": "^2.10.0",
72
72
  "eslint-plugin-svelte": "^3.12.4",
@@ -82,6 +82,7 @@
82
82
  "prettier": "^3.6.2",
83
83
  "sort-package-json": "^3.4.0",
84
84
  "svelte-eslint-parser": "^1.3.3",
85
+ "to-valid-identifier": "^0.1.1",
85
86
  "toml-eslint-parser": "^0.10.0",
86
87
  "yaml-eslint-parser": "^1.3.0"
87
88
  },
@@ -93,7 +94,7 @@
93
94
  "eslint-config-xo-typescript": "^9.0.0",
94
95
  "eslint-typegen": "^2.3.0",
95
96
  "globby": "^15.0.0",
96
- "svelte": "^5.39.9",
97
+ "svelte": "^5.40.0",
97
98
  "tsup": "^8.5.0"
98
99
  },
99
100
  "engines": {
package/readme.md CHANGED
@@ -40,14 +40,14 @@ To use just this ESLint config in isolation:
40
40
  1. Install the `.npmrc` in your project root. This is required for correct PNPM behavior:
41
41
 
42
42
  ```sh
43
- pnpm dlx @kitschpatrol/repo-config init
43
+ pnpm --package=@kitschpatrol/repo-config dlx ksc-repo init
44
44
  ```
45
45
 
46
46
  2. Install and initialize the required TypeScript `tsconfig.json` configuration in your project root:
47
47
 
48
48
  ```sh
49
49
  pnpm add -D @kitschpatrol/typescript-config
50
- pnpm dlx @kitschpatrol/typescript-config init
50
+ pnpm --package=@kitschpatrol/typescript-config dlx ksc-typescript init
51
51
  ```
52
52
 
53
53
  3. Add the package: