@fabdeh/eslint-config 0.13.0 → 0.13.2
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.mts +2 -1
- package/dist/index.mjs +117 -102
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -19302,7 +19302,8 @@ interface IsInEditorOptions {
|
|
|
19302
19302
|
*/
|
|
19303
19303
|
interface UnicornOptions {
|
|
19304
19304
|
/**
|
|
19305
|
-
* If set to `true`, enables all recommended settings from unicorn plugin
|
|
19305
|
+
* If set to `true`, enables all recommended settings from unicorn plugin, on top of (not instead of)
|
|
19306
|
+
* the curated rule set, so no curated rule is downgraded by the plugin's own recommended set.
|
|
19306
19307
|
*
|
|
19307
19308
|
* @default false
|
|
19308
19309
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -30,10 +30,10 @@ const CONFIG_PRESET_FULL_ON = {
|
|
|
30
30
|
pnpm: true,
|
|
31
31
|
regexp: true,
|
|
32
32
|
stylistic: { experimental: true },
|
|
33
|
-
tailwindcss: true,
|
|
33
|
+
tailwindcss: { enableAllRules: true },
|
|
34
34
|
toml: true,
|
|
35
35
|
typescript: { enableErasableSyntaxOnly: true },
|
|
36
|
-
unicorn: true,
|
|
36
|
+
unicorn: { allRecommended: true },
|
|
37
37
|
vitest: true,
|
|
38
38
|
yaml: true
|
|
39
39
|
};
|
|
@@ -1285,10 +1285,16 @@ async function ngrx(options = {}) {
|
|
|
1285
1285
|
...ngrxPlugin.configs.signals.find((c) => c.name === "ngrx/signals")?.rules,
|
|
1286
1286
|
"@typescript-eslint/naming-convention": [
|
|
1287
1287
|
"error",
|
|
1288
|
-
...namingConvention(!useRelaxedNamingConventionForCamelAndPascalCases),
|
|
1288
|
+
...namingConvention(!useRelaxedNamingConventionForCamelAndPascalCases, false),
|
|
1289
1289
|
{
|
|
1290
1290
|
selector: ["objectLiteralProperty", "objectLiteralMethod"],
|
|
1291
|
-
format: ["camelCase"],
|
|
1291
|
+
format: [useRelaxedNamingConventionForCamelAndPascalCases ? "camelCase" : "strictCamelCase"],
|
|
1292
|
+
leadingUnderscore: "allow"
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
selector: "parameter",
|
|
1296
|
+
modifiers: ["destructured"],
|
|
1297
|
+
format: [useRelaxedNamingConventionForCamelAndPascalCases ? "camelCase" : "strictCamelCase"],
|
|
1292
1298
|
leadingUnderscore: "allow"
|
|
1293
1299
|
},
|
|
1294
1300
|
{
|
|
@@ -1298,7 +1304,7 @@ async function ngrx(options = {}) {
|
|
|
1298
1304
|
"global",
|
|
1299
1305
|
"exported"
|
|
1300
1306
|
],
|
|
1301
|
-
format: ["PascalCase"],
|
|
1307
|
+
format: [useRelaxedNamingConventionForCamelAndPascalCases ? "PascalCase" : "StrictPascalCase"],
|
|
1302
1308
|
leadingUnderscore: "forbid",
|
|
1303
1309
|
trailingUnderscore: "forbid",
|
|
1304
1310
|
suffix: ["Store"]
|
|
@@ -2214,6 +2220,108 @@ async function typescript(options = {}, isWorkspaceProject = false) {
|
|
|
2214
2220
|
//#endregion
|
|
2215
2221
|
//#region src/configs/unicorn.ts
|
|
2216
2222
|
/**
|
|
2223
|
+
* The curated rule set of `eslint-plugin-unicorn`, including the project's own rule options
|
|
2224
|
+
* (such as the upper-case markdown exception for `unicorn/filename-case`). These stay in force even
|
|
2225
|
+
* when the full recommended set is enabled, so a stricter setting never silently downgrades a rule.
|
|
2226
|
+
*/
|
|
2227
|
+
const CURATED_RULES = {
|
|
2228
|
+
"unicorn/catch-error-name": "error",
|
|
2229
|
+
"unicorn/consistent-date-clone": "error",
|
|
2230
|
+
"unicorn/consistent-empty-array-spread": "error",
|
|
2231
|
+
"unicorn/consistent-existence-index-check": "error",
|
|
2232
|
+
"unicorn/consistent-function-scoping": ["error", { checkArrowFunctions: false }],
|
|
2233
|
+
"unicorn/custom-error-definition": "error",
|
|
2234
|
+
"unicorn/error-message": "error",
|
|
2235
|
+
"unicorn/escape-case": "error",
|
|
2236
|
+
"unicorn/explicit-length-check": "error",
|
|
2237
|
+
"unicorn/filename-case": ["error", {
|
|
2238
|
+
case: "kebabCase",
|
|
2239
|
+
ignore: [/^[A-Z0-9_-]+\.md$/]
|
|
2240
|
+
}],
|
|
2241
|
+
"unicorn/new-for-builtins": "error",
|
|
2242
|
+
"unicorn/no-abusive-eslint-disable": "error",
|
|
2243
|
+
"unicorn/no-anonymous-default-export": "error",
|
|
2244
|
+
"unicorn/no-array-for-each": "error",
|
|
2245
|
+
"unicorn/no-array-method-this-argument": "error",
|
|
2246
|
+
"unicorn/no-array-reduce": "error",
|
|
2247
|
+
"unicorn/no-await-expression-member": "error",
|
|
2248
|
+
"unicorn/no-await-in-promise-methods": "error",
|
|
2249
|
+
"unicorn/no-document-cookie": "error",
|
|
2250
|
+
"unicorn/no-empty-file": "error",
|
|
2251
|
+
"unicorn/no-for-loop": "error",
|
|
2252
|
+
"unicorn/no-hex-escape": "error",
|
|
2253
|
+
"unicorn/no-instanceof-builtins": "error",
|
|
2254
|
+
"unicorn/no-invalid-fetch-options": "error",
|
|
2255
|
+
"unicorn/no-invalid-remove-event-listener": "error",
|
|
2256
|
+
"unicorn/no-lonely-if": "error",
|
|
2257
|
+
"unicorn/no-magic-array-flat-depth": "error",
|
|
2258
|
+
"unicorn/no-negated-condition": "error",
|
|
2259
|
+
"unicorn/no-negation-in-equality-check": "error",
|
|
2260
|
+
"unicorn/no-new-array": "error",
|
|
2261
|
+
"unicorn/no-new-buffer": "error",
|
|
2262
|
+
"unicorn/no-null": "error",
|
|
2263
|
+
"unicorn/no-process-exit": "error",
|
|
2264
|
+
"unicorn/no-single-promise-in-promise-methods": "error",
|
|
2265
|
+
"unicorn/no-thenable": "error",
|
|
2266
|
+
"unicorn/no-this-assignment": "error",
|
|
2267
|
+
"unicorn/no-typeof-undefined": "error",
|
|
2268
|
+
"unicorn/no-unnecessary-await": "error",
|
|
2269
|
+
"unicorn/no-unnecessary-array-flat-depth": "error",
|
|
2270
|
+
"unicorn/no-unnecessary-array-splice-count": "error",
|
|
2271
|
+
"unicorn/no-unnecessary-slice-end": "error",
|
|
2272
|
+
"unicorn/no-unused-properties": "warn",
|
|
2273
|
+
"unicorn/no-useless-fallback-in-spread": "error",
|
|
2274
|
+
"unicorn/no-useless-length-check": "error",
|
|
2275
|
+
"unicorn/no-useless-promise-resolve-reject": "error",
|
|
2276
|
+
"unicorn/no-useless-spread": "error",
|
|
2277
|
+
"unicorn/no-useless-switch-case": "error",
|
|
2278
|
+
"unicorn/no-zero-fractions": "error",
|
|
2279
|
+
"unicorn/number-literal-case": "error",
|
|
2280
|
+
"unicorn/numeric-separators-style": "error",
|
|
2281
|
+
"unicorn/prefer-array-find": "error",
|
|
2282
|
+
"unicorn/prefer-array-flat": "error",
|
|
2283
|
+
"unicorn/prefer-array-flat-map": "error",
|
|
2284
|
+
"unicorn/prefer-array-index-of": "error",
|
|
2285
|
+
"unicorn/prefer-array-some": "error",
|
|
2286
|
+
"unicorn/prefer-at": "error",
|
|
2287
|
+
"unicorn/prefer-blob-reading-methods": "error",
|
|
2288
|
+
"unicorn/prefer-code-point": "error",
|
|
2289
|
+
"unicorn/prefer-date-now": "error",
|
|
2290
|
+
"unicorn/prefer-default-parameters": "error",
|
|
2291
|
+
"unicorn/prefer-export-from": "error",
|
|
2292
|
+
"unicorn/prefer-import-meta-properties": "error",
|
|
2293
|
+
"unicorn/prefer-includes": "error",
|
|
2294
|
+
"unicorn/prefer-keyboard-event-key": "error",
|
|
2295
|
+
"unicorn/prefer-logical-operator-over-ternary": "error",
|
|
2296
|
+
"unicorn/prefer-math-min-max": "error",
|
|
2297
|
+
"unicorn/prefer-math-trunc": "error",
|
|
2298
|
+
"unicorn/prefer-modern-math-apis": "error",
|
|
2299
|
+
"unicorn/prefer-negative-index": "error",
|
|
2300
|
+
"unicorn/prefer-node-protocol": "error",
|
|
2301
|
+
"unicorn/prefer-number-properties": "error",
|
|
2302
|
+
"unicorn/prefer-object-from-entries": "error",
|
|
2303
|
+
"unicorn/prefer-optional-catch-binding": "error",
|
|
2304
|
+
"unicorn/prefer-query-selector": "error",
|
|
2305
|
+
"unicorn/prefer-regexp-test": "error",
|
|
2306
|
+
"unicorn/prefer-set-has": "error",
|
|
2307
|
+
"unicorn/prefer-set-size": "error",
|
|
2308
|
+
"unicorn/prefer-single-call": "error",
|
|
2309
|
+
"unicorn/prefer-spread": "error",
|
|
2310
|
+
"unicorn/prefer-string-raw": "error",
|
|
2311
|
+
"unicorn/prefer-string-replace-all": "error",
|
|
2312
|
+
"unicorn/prefer-string-slice": "error",
|
|
2313
|
+
"unicorn/prefer-string-starts-ends-with": "error",
|
|
2314
|
+
"unicorn/prefer-string-trim-start-end": "error",
|
|
2315
|
+
"unicorn/prefer-structured-clone": "error",
|
|
2316
|
+
"unicorn/prefer-switch": "error",
|
|
2317
|
+
"unicorn/prefer-ternary": "error",
|
|
2318
|
+
"unicorn/prefer-type-error": "error",
|
|
2319
|
+
"unicorn/require-array-join-separator": "error",
|
|
2320
|
+
"unicorn/require-number-to-fixed-digits-argument": "error",
|
|
2321
|
+
"unicorn/require-post-message-target-origin": "error",
|
|
2322
|
+
"unicorn/throw-new-error": "error"
|
|
2323
|
+
};
|
|
2324
|
+
/**
|
|
2217
2325
|
* Generates a configuration array for the Unicorn plugin with the specified options.
|
|
2218
2326
|
*
|
|
2219
2327
|
* @param [options] - The options to customize the Unicorn rules.
|
|
@@ -2224,103 +2332,10 @@ function unicorn(options = {}) {
|
|
|
2224
2332
|
name: "fabdeh/unicorn/rules",
|
|
2225
2333
|
files: [GLOB_SRC],
|
|
2226
2334
|
plugins: { unicorn: unicornPlugin },
|
|
2227
|
-
rules:
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
"unicorn/consistent-existence-index-check": "error",
|
|
2232
|
-
"unicorn/consistent-function-scoping": ["error", { checkArrowFunctions: false }],
|
|
2233
|
-
"unicorn/custom-error-definition": "error",
|
|
2234
|
-
"unicorn/error-message": "error",
|
|
2235
|
-
"unicorn/escape-case": "error",
|
|
2236
|
-
"unicorn/explicit-length-check": "error",
|
|
2237
|
-
"unicorn/filename-case": ["error", {
|
|
2238
|
-
case: "kebabCase",
|
|
2239
|
-
ignore: [/^[A-Z0-9_-]+\.md$/]
|
|
2240
|
-
}],
|
|
2241
|
-
"unicorn/new-for-builtins": "error",
|
|
2242
|
-
"unicorn/no-abusive-eslint-disable": "error",
|
|
2243
|
-
"unicorn/no-anonymous-default-export": "error",
|
|
2244
|
-
"unicorn/no-array-for-each": "error",
|
|
2245
|
-
"unicorn/no-array-method-this-argument": "error",
|
|
2246
|
-
"unicorn/no-array-reduce": "error",
|
|
2247
|
-
"unicorn/no-await-expression-member": "error",
|
|
2248
|
-
"unicorn/no-await-in-promise-methods": "error",
|
|
2249
|
-
"unicorn/no-document-cookie": "error",
|
|
2250
|
-
"unicorn/no-empty-file": "error",
|
|
2251
|
-
"unicorn/no-for-loop": "error",
|
|
2252
|
-
"unicorn/no-hex-escape": "error",
|
|
2253
|
-
"unicorn/no-instanceof-builtins": "error",
|
|
2254
|
-
"unicorn/no-invalid-fetch-options": "error",
|
|
2255
|
-
"unicorn/no-invalid-remove-event-listener": "error",
|
|
2256
|
-
"unicorn/no-lonely-if": "error",
|
|
2257
|
-
"unicorn/no-magic-array-flat-depth": "error",
|
|
2258
|
-
"unicorn/no-negated-condition": "error",
|
|
2259
|
-
"unicorn/no-negation-in-equality-check": "error",
|
|
2260
|
-
"unicorn/no-new-array": "error",
|
|
2261
|
-
"unicorn/no-new-buffer": "error",
|
|
2262
|
-
"unicorn/no-null": "error",
|
|
2263
|
-
"unicorn/no-process-exit": "error",
|
|
2264
|
-
"unicorn/no-single-promise-in-promise-methods": "error",
|
|
2265
|
-
"unicorn/no-thenable": "error",
|
|
2266
|
-
"unicorn/no-this-assignment": "error",
|
|
2267
|
-
"unicorn/no-typeof-undefined": "error",
|
|
2268
|
-
"unicorn/no-unnecessary-await": "error",
|
|
2269
|
-
"unicorn/no-unnecessary-array-flat-depth": "error",
|
|
2270
|
-
"unicorn/no-unnecessary-array-splice-count": "error",
|
|
2271
|
-
"unicorn/no-unnecessary-slice-end": "error",
|
|
2272
|
-
"unicorn/no-unused-properties": "warn",
|
|
2273
|
-
"unicorn/no-useless-fallback-in-spread": "error",
|
|
2274
|
-
"unicorn/no-useless-length-check": "error",
|
|
2275
|
-
"unicorn/no-useless-promise-resolve-reject": "error",
|
|
2276
|
-
"unicorn/no-useless-spread": "error",
|
|
2277
|
-
"unicorn/no-useless-switch-case": "error",
|
|
2278
|
-
"unicorn/no-zero-fractions": "error",
|
|
2279
|
-
"unicorn/number-literal-case": "error",
|
|
2280
|
-
"unicorn/numeric-separators-style": "error",
|
|
2281
|
-
"unicorn/prefer-array-find": "error",
|
|
2282
|
-
"unicorn/prefer-array-flat": "error",
|
|
2283
|
-
"unicorn/prefer-array-flat-map": "error",
|
|
2284
|
-
"unicorn/prefer-array-index-of": "error",
|
|
2285
|
-
"unicorn/prefer-array-some": "error",
|
|
2286
|
-
"unicorn/prefer-at": "error",
|
|
2287
|
-
"unicorn/prefer-blob-reading-methods": "error",
|
|
2288
|
-
"unicorn/prefer-code-point": "error",
|
|
2289
|
-
"unicorn/prefer-date-now": "error",
|
|
2290
|
-
"unicorn/prefer-default-parameters": "error",
|
|
2291
|
-
"unicorn/prefer-export-from": "error",
|
|
2292
|
-
"unicorn/prefer-import-meta-properties": "error",
|
|
2293
|
-
"unicorn/prefer-includes": "error",
|
|
2294
|
-
"unicorn/prefer-keyboard-event-key": "error",
|
|
2295
|
-
"unicorn/prefer-logical-operator-over-ternary": "error",
|
|
2296
|
-
"unicorn/prefer-math-min-max": "error",
|
|
2297
|
-
"unicorn/prefer-math-trunc": "error",
|
|
2298
|
-
"unicorn/prefer-modern-math-apis": "error",
|
|
2299
|
-
"unicorn/prefer-negative-index": "error",
|
|
2300
|
-
"unicorn/prefer-node-protocol": "error",
|
|
2301
|
-
"unicorn/prefer-number-properties": "error",
|
|
2302
|
-
"unicorn/prefer-object-from-entries": "error",
|
|
2303
|
-
"unicorn/prefer-optional-catch-binding": "error",
|
|
2304
|
-
"unicorn/prefer-query-selector": "error",
|
|
2305
|
-
"unicorn/prefer-regexp-test": "error",
|
|
2306
|
-
"unicorn/prefer-set-has": "error",
|
|
2307
|
-
"unicorn/prefer-set-size": "error",
|
|
2308
|
-
"unicorn/prefer-single-call": "error",
|
|
2309
|
-
"unicorn/prefer-spread": "error",
|
|
2310
|
-
"unicorn/prefer-string-raw": "error",
|
|
2311
|
-
"unicorn/prefer-string-replace-all": "error",
|
|
2312
|
-
"unicorn/prefer-string-slice": "error",
|
|
2313
|
-
"unicorn/prefer-string-starts-ends-with": "error",
|
|
2314
|
-
"unicorn/prefer-string-trim-start-end": "error",
|
|
2315
|
-
"unicorn/prefer-structured-clone": "error",
|
|
2316
|
-
"unicorn/prefer-switch": "error",
|
|
2317
|
-
"unicorn/prefer-ternary": "error",
|
|
2318
|
-
"unicorn/prefer-type-error": "error",
|
|
2319
|
-
"unicorn/require-array-join-separator": "error",
|
|
2320
|
-
"unicorn/require-number-to-fixed-digits-argument": "error",
|
|
2321
|
-
"unicorn/require-post-message-target-origin": "error",
|
|
2322
|
-
"unicorn/throw-new-error": "error"
|
|
2323
|
-
} }
|
|
2335
|
+
rules: options.allRecommended ? {
|
|
2336
|
+
...unicornPlugin.configs.recommended.rules,
|
|
2337
|
+
...CURATED_RULES
|
|
2338
|
+
} : CURATED_RULES
|
|
2324
2339
|
}];
|
|
2325
2340
|
}
|
|
2326
2341
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabdeh/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.2",
|
|
5
5
|
"description": "My personal eslint config preset",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Fabien Dehopré",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"tsx": "^4.23.12",
|
|
127
127
|
"typescript": "^6.0.3",
|
|
128
128
|
"vitest": "^4.1.10",
|
|
129
|
-
"@fabdeh/eslint-config": "0.13.
|
|
129
|
+
"@fabdeh/eslint-config": "0.13.2"
|
|
130
130
|
},
|
|
131
131
|
"simple-git-hooks": {
|
|
132
132
|
"pre-commit": "pnpm nano-staged",
|