@kitschpatrol/eslint-config 5.3.0 → 5.4.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.js CHANGED
@@ -763,7 +763,7 @@ var jsonPrettierRules = {
763
763
 
764
764
  // src/presets/json-package.ts
765
765
  var jsonPackageRecommendedRules = {
766
- // Begin expansion 'eslint-plugin-package-json/configs/recommended' 'rules'
766
+ // Begin expansion 'eslint-plugin-package-json' 'configs.recommended.rules'
767
767
  "json-package/no-empty-fields": "error",
768
768
  "json-package/order-properties": "error",
769
769
  "json-package/require-name": "error",
@@ -1295,7 +1295,8 @@ var prettierRules = {
1295
1295
  // src/presets/react.ts
1296
1296
  var reactRecommendedTypeCheckedRules = {
1297
1297
  // Begin expansion '@eslint-react/eslint-plugin' 'recommended-type-checked'
1298
- "react/ensure-forward-ref-using-ref": "warn",
1298
+ "react/jsx-no-duplicate-props": "off",
1299
+ "react/jsx-uses-vars": "off",
1299
1300
  "react/no-access-state-in-setstate": "error",
1300
1301
  "react/no-array-index-key": "warn",
1301
1302
  "react/no-children-count": "warn",
@@ -1312,12 +1313,11 @@ var reactRecommendedTypeCheckedRules = {
1312
1313
  "react/no-create-ref": "error",
1313
1314
  "react/no-default-props": "error",
1314
1315
  "react/no-direct-mutation-state": "error",
1315
- "react/no-duplicate-jsx-props": "off",
1316
1316
  "react/no-duplicate-key": "warn",
1317
1317
  "react/no-forward-ref": "warn",
1318
1318
  "react/no-implicit-key": "warn",
1319
1319
  "react/no-missing-key": "error",
1320
- "react/no-nested-components": "error",
1320
+ "react/no-nested-component-definitions": "error",
1321
1321
  "react/no-prop-types": "error",
1322
1322
  "react/no-redundant-should-component-update": "error",
1323
1323
  "react/no-set-state-in-component-did-mount": "warn",
@@ -1332,28 +1332,30 @@ var reactRecommendedTypeCheckedRules = {
1332
1332
  "react/no-unused-class-component-members": "warn",
1333
1333
  "react/no-unused-state": "warn",
1334
1334
  "react/no-use-context": "warn",
1335
- "react/use-jsx-vars": "off",
1335
+ "react/no-useless-forward-ref": "warn",
1336
+ "react/no-useless-fragment": "warn",
1336
1337
  "react-dom/no-dangerously-set-innerhtml": "warn",
1337
1338
  "react-dom/no-dangerously-set-innerhtml-with-children": "error",
1338
1339
  "react-dom/no-find-dom-node": "error",
1340
+ "react-dom/no-flush-sync": "error",
1339
1341
  "react-dom/no-missing-button-type": "warn",
1340
1342
  "react-dom/no-missing-iframe-sandbox": "warn",
1341
1343
  "react-dom/no-namespace": "error",
1344
+ "react-dom/no-render": "error",
1342
1345
  "react-dom/no-render-return-value": "error",
1343
1346
  "react-dom/no-script-url": "warn",
1347
+ "react-dom/no-unknown-property": "off",
1344
1348
  "react-dom/no-unsafe-iframe-sandbox": "warn",
1345
1349
  "react-dom/no-unsafe-target-blank": "warn",
1346
- "react-dom/no-void-elements-with-children": "warn",
1350
+ "react-dom/no-use-form-state": "error",
1351
+ "react-dom/no-void-elements-with-children": "error",
1347
1352
  "react-web-api/no-leaked-event-listener": "warn",
1348
1353
  "react-web-api/no-leaked-interval": "warn",
1349
1354
  "react-web-api/no-leaked-resize-observer": "warn",
1350
1355
  "react-web-api/no-leaked-timeout": "warn",
1351
1356
  "react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
1352
- "react-hooks-extra/no-useless-custom-hooks": "warn",
1357
+ "react-hooks-extra/no-unnecessary-use-prefix": "warn",
1353
1358
  "react-hooks-extra/prefer-use-state-lazy-initialization": "warn",
1354
- "react-naming-convention/context-name": "warn",
1355
- "react-naming-convention/use-state": "warn",
1356
- "react-dom/no-unknown-property": "off",
1357
1359
  "react/no-leaked-conditional-rendering": "warn"
1358
1360
  // End expansion
1359
1361
  };
@@ -1464,6 +1466,8 @@ var svelteRecommendedRules = {
1464
1466
  "svelte/no-store-async": "error",
1465
1467
  "svelte/no-svelte-internal": "error",
1466
1468
  "svelte/no-unknown-style-directive-property": "error",
1469
+ "svelte/no-unnecessary-state-wrap": "error",
1470
+ "svelte/no-unused-props": "error",
1467
1471
  "svelte/no-unused-svelte-ignore": "error",
1468
1472
  "svelte/no-useless-children-snippet": "error",
1469
1473
  "svelte/no-useless-mustaches": "error",
@@ -1953,7 +1957,14 @@ var xoTypescriptRules = {
1953
1957
  ],
1954
1958
  "ts/consistent-type-definitions": ["error", "type"],
1955
1959
  "ts/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }],
1956
- "ts/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }],
1960
+ "ts/consistent-type-imports": [
1961
+ "error",
1962
+ {
1963
+ disallowTypeAnnotations: false,
1964
+ fixStyle: "separate-type-imports",
1965
+ prefer: "type-imports"
1966
+ }
1967
+ ],
1957
1968
  "func-call-spacing": "off",
1958
1969
  // "@stylistic/func-call-spacing":["error","never"],
1959
1970
  indent: "off",
@@ -2259,7 +2270,7 @@ async function combine(...configs) {
2259
2270
  }
2260
2271
  async function interopDefault(m) {
2261
2272
  const resolved = await m;
2262
- return resolved.default || resolved;
2273
+ return resolved.default ?? resolved;
2263
2274
  }
2264
2275
  function isInEditorEnv() {
2265
2276
  if (process2.env.CI) return false;
@@ -2403,13 +2414,16 @@ var sharedScriptConfig = {
2403
2414
  }
2404
2415
  ],
2405
2416
  "eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
2417
+ "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
2406
2418
  // Overlaps with `unicorn/no-named-default`, and gives false positives for imports from CJS modules
2407
2419
  "import/default": "off",
2408
2420
  // IMO using the default can help with code readability / disambiguation of a function's origin
2409
2421
  "import/no-named-as-default-member": "off",
2410
- // Cope with Astro virtual modules
2422
+ // Cope with Astro virtual modules.
2423
+ // Astro uses `astro:...` and `@astrojs/...`.
2424
+ // Starlight uses `virtual:...`.
2411
2425
  // https://github.com/hannoeru/vite-plugin-pages/issues/41#issuecomment-1371880072
2412
- "import/no-unresolved": ["error", { ignore: ["^astro:", "^@astrojs"] }],
2426
+ "import/no-unresolved": ["error", { ignore: ["^astro:", "^@astrojs", "^virtual:"] }],
2413
2427
  "import/order": "off",
2414
2428
  // Conflicts with perfectionist/sort-imports (but never enabled)
2415
2429
  // Knip workaround to ignore unused exported class members:
@@ -2579,6 +2593,8 @@ var sharedScriptConfig = {
2579
2593
  ],
2580
2594
  "ts/sort-type-constituents": "off",
2581
2595
  // Conflicts with perfectionist/sort-intersection-types
2596
+ "unicorn/import-style": "off",
2597
+ // Conflicts with import/consistent-type-specifier-style prefer-top-level
2582
2598
  "unicorn/prevent-abbreviations": [
2583
2599
  "error",
2584
2600
  {
@@ -3303,7 +3319,7 @@ async function json(options = {}) {
3303
3319
  name: "kp/json/rules-tsconfig",
3304
3320
  rules: {
3305
3321
  "json/no-comments": "off",
3306
- "json/sort-keys": [
3322
+ "jsonc/sort-keys": [
3307
3323
  "error",
3308
3324
  {
3309
3325
  order: ["extends", "compilerOptions", "references", "files", "include", "exclude"],
@@ -3331,6 +3347,7 @@ async function json(options = {}) {
3331
3347
  "useDefineForClassFields",
3332
3348
  "emitDecoratorMetadata",
3333
3349
  "experimentalDecorators",
3350
+ "libReplacement",
3334
3351
  /* Modules */
3335
3352
  "baseUrl",
3336
3353
  "rootDir",
@@ -3405,6 +3422,7 @@ async function json(options = {}) {
3405
3422
  "isolatedModules",
3406
3423
  "preserveSymlinks",
3407
3424
  "verbatimModuleSyntax",
3425
+ "erasableSyntaxOnly",
3408
3426
  /* Completeness */
3409
3427
  "skipDefaultLibCheck",
3410
3428
  "skipLibCheck"
@@ -3823,7 +3841,7 @@ import globals3 from "globals";
3823
3841
  var _pluginTest;
3824
3842
  async function test(options = {}) {
3825
3843
  const { isInEditor = false, overrides = {} } = options;
3826
- _pluginTest ||= {
3844
+ _pluginTest ??= {
3827
3845
  ...pluginTest,
3828
3846
  // eslint-disable-next-line ts/no-unsafe-assignment
3829
3847
  rules: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitschpatrol/eslint-config",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "description": "ESLint configuration for @kitschpatrol/shared-config.",
5
5
  "keywords": [
6
6
  "shared-config",
@@ -42,35 +42,35 @@
42
42
  ],
43
43
  "dependencies": {
44
44
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
45
- "@eslint-react/eslint-plugin": "^1.30.1",
46
- "@html-eslint/eslint-plugin": "^0.35.0",
47
- "@html-eslint/parser": "^0.35.0",
45
+ "@eslint-react/eslint-plugin": "^1.38.2",
46
+ "@html-eslint/eslint-plugin": "^0.37.0",
47
+ "@html-eslint/parser": "^0.37.0",
48
48
  "@pinojs/json-colorizer": "^4.0.0",
49
- "@typescript-eslint/eslint-plugin": "^8.26.0",
50
- "@typescript-eslint/parser": "^8.26.0",
51
- "@vitest/eslint-plugin": "^1.1.36",
52
- "astro-eslint-parser": "^1.2.1",
53
- "eslint": "^9.21.0",
49
+ "@typescript-eslint/eslint-plugin": "^8.28.0",
50
+ "@typescript-eslint/parser": "^8.28.0",
51
+ "@vitest/eslint-plugin": "^1.1.38",
52
+ "astro-eslint-parser": "^1.2.2",
53
+ "eslint": "^9.23.0",
54
54
  "eslint-config-flat-gitignore": "^2.1.0",
55
55
  "eslint-flat-config-utils": "^2.0.1",
56
- "eslint-import-resolver-typescript": "^3.8.3",
57
- "eslint-mdx": "^3.1.5",
56
+ "eslint-import-resolver-typescript": "^3.10.0",
57
+ "eslint-mdx": "^3.3.1",
58
58
  "eslint-plugin-astro": "^1.3.1",
59
59
  "eslint-plugin-depend": "^0.12.0",
60
60
  "eslint-plugin-html": "^8.1.2",
61
- "eslint-plugin-import-x": "^4.6.1",
62
- "eslint-plugin-jsdoc": "^50.6.3",
63
- "eslint-plugin-jsonc": "^2.19.1",
61
+ "eslint-plugin-import-x": "^4.9.3",
62
+ "eslint-plugin-jsdoc": "^50.6.9",
63
+ "eslint-plugin-jsonc": "^2.20.0",
64
64
  "eslint-plugin-jsx-a11y": "^6.10.2",
65
- "eslint-plugin-mdx": "^3.1.5",
66
- "eslint-plugin-n": "^17.16.1",
65
+ "eslint-plugin-mdx": "^3.3.1",
66
+ "eslint-plugin-n": "^17.17.0",
67
67
  "eslint-plugin-no-only-tests": "^3.3.0",
68
- "eslint-plugin-package-json": "^0.26.2",
69
- "eslint-plugin-perfectionist": "^4.9.0",
68
+ "eslint-plugin-package-json": "^0.29.0",
69
+ "eslint-plugin-perfectionist": "^4.10.1",
70
70
  "eslint-plugin-regexp": "^2.7.0",
71
- "eslint-plugin-svelte": "^3.0.2",
71
+ "eslint-plugin-svelte": "^3.3.3",
72
72
  "eslint-plugin-toml": "^0.12.0",
73
- "eslint-plugin-unicorn": "^57.0.0",
73
+ "eslint-plugin-unicorn": "^58.0.0",
74
74
  "eslint-plugin-yml": "^1.17.0",
75
75
  "execa": "^9.5.2",
76
76
  "find-workspaces": "^0.3.1",
@@ -79,8 +79,8 @@
79
79
  "jsonc-eslint-parser": "^2.4.0",
80
80
  "local-pkg": "^1.1.1",
81
81
  "prettier": "^3.5.3",
82
- "sort-package-json": "^2.15.1",
83
- "svelte-eslint-parser": "^1.0.0",
82
+ "sort-package-json": "^3.0.0",
83
+ "svelte-eslint-parser": "^1.1.1",
84
84
  "toml-eslint-parser": "^0.10.0",
85
85
  "yaml-eslint-parser": "^1.3.0"
86
86
  },
@@ -88,11 +88,11 @@
88
88
  "@types/eslint-config-prettier": "^6.11.3",
89
89
  "@types/eslint-plugin-jsx-a11y": "^6.10.0",
90
90
  "dot-prop": "^9.0.0",
91
- "eslint-config-prettier": "^10.0.2",
91
+ "eslint-config-prettier": "^10.1.1",
92
92
  "eslint-config-xo-typescript": "^7.0.0",
93
- "eslint-typegen": "^2.0.0",
93
+ "eslint-typegen": "^2.1.0",
94
94
  "globby": "^14.1.0",
95
- "svelte": "^5.22.1",
95
+ "svelte": "^5.25.3",
96
96
  "tsup": "^8.4.0"
97
97
  },
98
98
  "engines": {
package/readme.md CHANGED
@@ -187,8 +187,6 @@ kpi-eslint print-config [file]
187
187
 
188
188
  Regrettably the `eslint-config init --location package` option is not supported due to ESLint 9's deprecation of support for putting configuration in `package.json`. See ESLint discussion thread [18131](https://github.com/eslint/eslint/discussions/18131).
189
189
 
190
- [`eslint-plugin-mdx`](https://www.npmjs.com/package/eslint-plugin-mdx) currently depends on an old version of [`eslint-plugin-markdown`](https://www.npmjs.com/package/eslint-plugin-markdown) which does not officially support ESLint 9. This dependency is overridden at the root of the [`@kitschpatrol/shared-config` monorepo](https://github.com/kitschpatrol/shared-config). See the [related issue #477](https://github.com/mdx-js/eslint-mdx/issues/477) in the `eslint-mdx` repo.
191
-
192
190
  ### Origins
193
191
 
194
192
  This config is a heavily modified variation on Anthony Fu's [@antfu/eslint-config](https://github.com/antfu/eslint-config). This package is a somewhat leaner approach intended to work with other tools wrapped behind a monolithic CLI instead of handling everything on its own. It mainly leverages the factory / type generation implementation from the original repo, which itself builds on Kevin Deng's [@sxzz/eslint-config](https://github.com/sxzz/eslint-config). See the [modification notes](./modification-notes.md) for more details on what's changed from Anthony's approach.
package/init/package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "pnpm": {
3
- "overrides": {
4
- "eslint-plugin-markdown": "^5.1.0"
5
- }
6
- }
7
- }