@book000/eslint-config 1.17.17 → 1.18.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.
Files changed (3) hide show
  1. package/index.mjs +3 -1
  2. package/package.json +2 -2
  3. package/test.mjs +18 -0
package/index.mjs CHANGED
@@ -120,7 +120,6 @@ export default tseslint.config(
120
120
  "unicorn/no-array-sort-for-min-max": "error",
121
121
  "unicorn/no-array-splice": "error",
122
122
  "unicorn/no-async-iterator-callback": "error",
123
- "unicorn/no-async-promise-finally": "error",
124
123
  "unicorn/no-await-expression-member": "error",
125
124
  "unicorn/no-await-in-promise-methods": "error",
126
125
  "unicorn/no-blob-to-file": "error",
@@ -342,9 +341,11 @@ export default tseslint.config(
342
341
  "unicorn/prefer-promise-try": "error",
343
342
  "unicorn/prefer-promise-with-resolvers": "error",
344
343
  "unicorn/prefer-prototype-methods": "error",
344
+ "unicorn/prefer-options-parameter": "error",
345
345
  "unicorn/prefer-query-selector": "error",
346
346
  "unicorn/prefer-queue-microtask": "error",
347
347
  "unicorn/prefer-reflect-apply": "error",
348
+ "unicorn/prefer-regexp-exec": "error",
348
349
  "unicorn/prefer-regexp-test": "error",
349
350
  "unicorn/prefer-response-static-json": "error",
350
351
  "unicorn/prefer-scoped-selector": "error",
@@ -390,6 +391,7 @@ export default tseslint.config(
390
391
  "unicorn/require-module-specifiers": "error",
391
392
  "unicorn/require-number-to-fixed-digits-argument": "error",
392
393
  "unicorn/require-passive-events": "error",
394
+ "unicorn/require-spread-parentheses": "error",
393
395
  "unicorn/require-proxy-trap-boolean-return": "error",
394
396
  "unicorn/require-text-decoder-streaming": "error",
395
397
  "unicorn/switch-case-braces": "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@book000/eslint-config",
3
- "version": "1.17.17",
3
+ "version": "1.18.0",
4
4
  "description": "ESLint config",
5
5
  "keywords": [
6
6
  "eslint-config"
@@ -19,7 +19,7 @@
19
19
  "dependencies": {
20
20
  "@typescript-eslint/parser": "8.74.0",
21
21
  "eslint-config-prettier": "10.1.9",
22
- "eslint-plugin-unicorn": "79.0.0",
22
+ "eslint-plugin-unicorn": "80.0.0",
23
23
  "globals": "17.14.0",
24
24
  "neostandard": "0.14.1",
25
25
  "typescript-eslint": "8.74.0"
package/test.mjs CHANGED
@@ -426,6 +426,24 @@ async function main(cleanups) {
426
426
  shouldError: true,
427
427
  rules: ["unicorn/no-unnecessary-string-trim"],
428
428
  },
429
+ {
430
+ name: "prefer-options-parameter: optional positional parameters before an options object are an error (a rule added by the unicorn resync)",
431
+ code: "export function f(a: string, b?: number, c?: number, options?: { d: number }) { return [a, b, c, options]; }",
432
+ shouldError: true,
433
+ rules: ["unicorn/prefer-options-parameter"],
434
+ },
435
+ {
436
+ name: "prefer-regexp-exec: String#match() with a non-global regex is an error (a rule added by the unicorn resync)",
437
+ code: "export const a = 'abc'.match(/b/);",
438
+ shouldError: true,
439
+ rules: ["unicorn/prefer-regexp-exec"],
440
+ },
441
+ {
442
+ name: "require-spread-parentheses: an unparenthesized conditional spread argument is an error (a rule added by the unicorn resync)",
443
+ code: "export const a = Math.max(...true ? [1] : [2]);",
444
+ shouldError: true,
445
+ rules: ["unicorn/require-spread-parentheses"],
446
+ },
429
447
  ];
430
448
 
431
449
  // Create temp files under src/ so they match the TypeScript config.