@kitschpatrol/eslint-config 5.2.0 → 5.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/bin/cli.js +1 -1
- package/dist/index.js +17 -7
- package/package.json +4 -4
- package/readme.md +2 -0
package/bin/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -2399,12 +2399,14 @@ var sharedScriptConfig = {
|
|
|
2399
2399
|
ignoreConsecutiveComments: true,
|
|
2400
2400
|
ignoreInlineComments: true,
|
|
2401
2401
|
// Forgive some additional common patterns arising from temporarily commenting out lines of code
|
|
2402
|
-
ignorePattern: String.raw`if|else|await|const|let|var|import|export|pragma|ignore|prettier-ignore|webpack\w+:|c8|type-coverage:`
|
|
2402
|
+
ignorePattern: String.raw`if|else|await|macOS|const|let|var|import|export|pragma|ignore|prettier-ignore|webpack\w+:|c8|type-coverage:`
|
|
2403
2403
|
}
|
|
2404
2404
|
],
|
|
2405
2405
|
"eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
|
|
2406
2406
|
// Overlaps with `unicorn/no-named-default`, and gives false positives for imports from CJS modules
|
|
2407
2407
|
"import/default": "off",
|
|
2408
|
+
// IMO using the default can help with code readability / disambiguation of a function's origin
|
|
2409
|
+
"import/no-named-as-default-member": "off",
|
|
2408
2410
|
// Cope with Astro virtual modules
|
|
2409
2411
|
// https://github.com/hannoeru/vite-plugin-pages/issues/41#issuecomment-1371880072
|
|
2410
2412
|
"import/no-unresolved": ["error", { ignore: ["^astro:", "^@astrojs"] }],
|
|
@@ -2422,15 +2424,17 @@ var sharedScriptConfig = {
|
|
|
2422
2424
|
],
|
|
2423
2425
|
"max-params": ["warn", { max: 8 }],
|
|
2424
2426
|
"no-await-in-loop": "off",
|
|
2425
|
-
"no-unreachable": "warn",
|
|
2426
2427
|
// TSConfig must have allowUnreachableCode: false, this is preferable because it will flag but not spontaneously delete unreachable code
|
|
2428
|
+
"no-unreachable": "warn",
|
|
2427
2429
|
"no-warning-comments": "off",
|
|
2428
2430
|
"node/hashbang": "off",
|
|
2429
2431
|
"node/no-extraneous-import": "off",
|
|
2430
|
-
"node/no-missing-import": "off",
|
|
2431
2432
|
// Trouble resolving in ts
|
|
2432
|
-
"node/no-
|
|
2433
|
+
"node/no-missing-import": "off",
|
|
2433
2434
|
// Duplicated in unicorn
|
|
2435
|
+
"node/no-process-exit": "off",
|
|
2436
|
+
// Too many false positives
|
|
2437
|
+
"node/no-unpublished-import": "off",
|
|
2434
2438
|
"node/no-unsupported-features/node-builtins": ["error", { ignores: ["fs/promises.glob"] }],
|
|
2435
2439
|
"perfectionist/sort-imports": [
|
|
2436
2440
|
"error",
|
|
@@ -2446,6 +2450,12 @@ var sharedScriptConfig = {
|
|
|
2446
2450
|
"perfectionist/sort-modules": "off",
|
|
2447
2451
|
"perfectionist/sort-objects": [
|
|
2448
2452
|
"error",
|
|
2453
|
+
// Note precedence sensitivity...
|
|
2454
|
+
// This has to come before the `min` rules to sort
|
|
2455
|
+
// strings like `{ minImageWidth: 1, minImageHeight: 1 }` correctly
|
|
2456
|
+
generatePerfectionistSortConfig(["width", "height"]),
|
|
2457
|
+
generatePerfectionistSortConfig(["width", "height"], "leading"),
|
|
2458
|
+
generatePerfectionistSortConfig(["Width", "Height"], "trailing"),
|
|
2449
2459
|
generatePerfectionistSortConfig(["r", "g", "b"]),
|
|
2450
2460
|
generatePerfectionistSortConfig(["R", "G", "B"], "trailing"),
|
|
2451
2461
|
generatePerfectionistSortConfig(["red", "green", "blue"]),
|
|
@@ -2462,12 +2472,12 @@ var sharedScriptConfig = {
|
|
|
2462
2472
|
generatePerfectionistSortConfig(["Red", "Green", "Blue", "Alpha"], "trailing"),
|
|
2463
2473
|
generatePerfectionistSortConfig(["x", "y", "z", "w"]),
|
|
2464
2474
|
generatePerfectionistSortConfig(["X", "Y", "Z", "W"], "trailing"),
|
|
2475
|
+
generatePerfectionistSortConfig(["start", "end"]),
|
|
2476
|
+
generatePerfectionistSortConfig(["start", "end"], "leading"),
|
|
2477
|
+
generatePerfectionistSortConfig(["Start", "End"], "trailing"),
|
|
2465
2478
|
generatePerfectionistSortConfig(["min", "max"]),
|
|
2466
2479
|
generatePerfectionistSortConfig(["min", "max"], "leading"),
|
|
2467
2480
|
generatePerfectionistSortConfig(["Min", "Max"], "trailing"),
|
|
2468
|
-
generatePerfectionistSortConfig(["width", "height"]),
|
|
2469
|
-
generatePerfectionistSortConfig(["width", "height"], "leading"),
|
|
2470
|
-
generatePerfectionistSortConfig(["Width", "Height"], "trailing"),
|
|
2471
2481
|
{ newlinesBetween: "never", order: "asc", type: "natural" }
|
|
2472
2482
|
],
|
|
2473
2483
|
"sort-imports": "off",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/eslint-config",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "ESLint configuration for @kitschpatrol/shared-config.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shared-config",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
45
|
-
"@eslint-react/eslint-plugin": "^1.30.
|
|
45
|
+
"@eslint-react/eslint-plugin": "^1.30.1",
|
|
46
46
|
"@html-eslint/eslint-plugin": "^0.35.0",
|
|
47
47
|
"@html-eslint/parser": "^0.35.0",
|
|
48
48
|
"@pinojs/json-colorizer": "^4.0.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"eslint-plugin-mdx": "^3.1.5",
|
|
66
66
|
"eslint-plugin-n": "^17.16.1",
|
|
67
67
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
68
|
-
"eslint-plugin-package-json": "^0.26.
|
|
68
|
+
"eslint-plugin-package-json": "^0.26.2",
|
|
69
69
|
"eslint-plugin-perfectionist": "^4.9.0",
|
|
70
70
|
"eslint-plugin-regexp": "^2.7.0",
|
|
71
71
|
"eslint-plugin-svelte": "^3.0.2",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"eslint-config-xo-typescript": "^7.0.0",
|
|
93
93
|
"eslint-typegen": "^2.0.0",
|
|
94
94
|
"globby": "^14.1.0",
|
|
95
|
-
"svelte": "^5.
|
|
95
|
+
"svelte": "^5.22.1",
|
|
96
96
|
"tsup": "^8.4.0"
|
|
97
97
|
},
|
|
98
98
|
"engines": {
|
package/readme.md
CHANGED
|
@@ -187,6 +187,8 @@ 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
|
+
|
|
190
192
|
### Origins
|
|
191
193
|
|
|
192
194
|
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.
|