@ncontiero/eslint-config 8.2.0 → 8.2.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 CHANGED
@@ -277,10 +277,18 @@ interface RuleOptions {
277
277
  * Disallow dependencies in favor of more performant or secure alternatives
278
278
  */
279
279
  'e18e/ban-dependencies'?: Linter.RuleEntry<E18EBanDependencies>;
280
+ /**
281
+ * Disallow `delete` on properties — V8 deoptimizes the object to dictionary mode
282
+ */
283
+ 'e18e/no-delete-property'?: Linter.RuleEntry<[]>;
280
284
  /**
281
285
  * Prefer optimized alternatives to `indexOf()` equality checks
282
286
  */
283
287
  'e18e/no-indexof-equality'?: Linter.RuleEntry<[]>;
288
+ /**
289
+ * Disallow spreading the accumulator inside a `reduce` callback (O(N²) growth)
290
+ */
291
+ 'e18e/no-spread-in-reduce'?: Linter.RuleEntry<[]>;
284
292
  /**
285
293
  * Prefer Array.prototype.at() over length-based indexing
286
294
  */
@@ -294,7 +302,7 @@ interface RuleOptions {
294
302
  */
295
303
  'e18e/prefer-array-from-map'?: Linter.RuleEntry<[]>;
296
304
  /**
297
- * Prefer Array.some() over Array.find() when checking for element existence
305
+ * Prefer Array.some() over Array.find() and Array.filter().length checks when checking for element existence
298
306
  */
299
307
  'e18e/prefer-array-some'?: Linter.RuleEntry<[]>;
300
308
  /**
@@ -321,6 +329,10 @@ interface RuleOptions {
321
329
  * Prefer .includes() over indexOf() comparisons for arrays and strings
322
330
  */
323
331
  'e18e/prefer-includes'?: Linter.RuleEntry<[]>;
332
+ /**
333
+ * Prefer String.prototype.{includes,startsWith,endsWith} over equivalent regex.test() calls
334
+ */
335
+ 'e18e/prefer-includes-over-regex-test'?: Linter.RuleEntry<[]>;
324
336
  /**
325
337
  * Prefer inline equality checks over temporary object creation for simple comparisons
326
338
  */
@@ -341,10 +353,18 @@ interface RuleOptions {
341
353
  * Prefer spread syntax over Array.concat(), Array.from(), Object.assign({}, ...), and Function.apply()
342
354
  */
343
355
  'e18e/prefer-spread-syntax'?: Linter.RuleEntry<[]>;
356
+ /**
357
+ * Prefer hoisting an `Intl.Collator` instance over calling localeCompare in a sort callback
358
+ */
359
+ 'e18e/prefer-static-collator'?: Linter.RuleEntry<[]>;
344
360
  /**
345
361
  * Prefer defining regular expressions at module scope to avoid re-compilation on every function call
346
362
  */
347
363
  'e18e/prefer-static-regex'?: Linter.RuleEntry<[]>;
364
+ /**
365
+ * Prefer String.fromCharCode() over String.fromCodePoint() for code points below 0x10000
366
+ */
367
+ 'e18e/prefer-string-fromcharcode'?: Linter.RuleEntry<[]>;
348
368
  /**
349
369
  * Prefer passing function and arguments directly to setTimeout/setInterval instead of wrapping in an arrow function or using bind
350
370
  */
@@ -3719,46 +3739,46 @@ interface RuleOptions {
3719
3739
  'react/immutability'?: Linter.RuleEntry<[]>;
3720
3740
  /**
3721
3741
  * Disallows passing 'children' as a prop.
3722
- * @see https://eslint-react.xyz/docs/rules/no-children-prop
3742
+ * @see https://eslint-react.xyz/docs/rules/jsx-no-children-prop
3723
3743
  */
3724
3744
  'react/jsx-no-children-prop'?: Linter.RuleEntry<[]>;
3725
3745
  /**
3726
3746
  * Disallows passing 'children' as a prop when children are also passed as nested content.
3727
- * @see https://eslint-react.xyz/docs/rules/no-children-prop-with-children
3747
+ * @see https://eslint-react.xyz/docs/rules/jsx-no-children-prop-with-children
3728
3748
  */
3729
3749
  'react/jsx-no-children-prop-with-children'?: Linter.RuleEntry<[]>;
3730
3750
  /**
3731
3751
  * Prevents comment strings from being accidentally inserted into a JSX element's text nodes.
3732
- * @see https://eslint-react.xyz/docs/rules/no-comment-textnodes
3752
+ * @see https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
3733
3753
  */
3734
3754
  'react/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>;
3735
3755
  /**
3736
3756
  * Prevent patterns that cause deoptimization when using the automatic JSX runtime.
3737
- * @see https://eslint-react.xyz/docs/rules/no-key-after-spread
3757
+ * @see https://eslint-react.xyz/docs/rules/jsx-no-key-after-spread
3738
3758
  */
3739
3759
  'react/jsx-no-key-after-spread'?: Linter.RuleEntry<[]>;
3740
3760
  /**
3741
3761
  * Catches `$` before `{expr}` in JSX — typically from template literal `${expr}` being copy-pasted into JSX without removing the `$`. The `$` "leaks" into the rendered output.
3742
- * @see https://eslint-react.xyz/docs/rules/no-leaked-dollar
3762
+ * @see https://eslint-react.xyz/docs/rules/jsx-no-leaked-dollar
3743
3763
  */
3744
3764
  'react/jsx-no-leaked-dollar'?: Linter.RuleEntry<[]>;
3745
3765
  /**
3746
3766
  * Catches `;` at the start of JSX text nodes — typically from accidentally placing a statement-ending `;` inside JSX. The `;` "leaks" into the rendered output.
3747
- * @see https://eslint-react.xyz/docs/rules/no-leaked-semicolon
3767
+ * @see https://eslint-react.xyz/docs/rules/jsx-no-leaked-semicolon
3748
3768
  */
3749
3769
  'react/jsx-no-leaked-semicolon'?: Linter.RuleEntry<[]>;
3750
3770
  /**
3751
3771
  * Disallow JSX namespace syntax, as React does not support them.
3752
- * @see https://eslint-react.xyz/docs/rules/no-namespace
3772
+ * @see https://eslint-react.xyz/docs/rules/jsx-no-namespace
3753
3773
  */
3754
3774
  'react/jsx-no-namespace'?: Linter.RuleEntry<[]>;
3755
3775
  /**
3756
3776
  * Disallows useless fragment elements.
3757
- * @see https://eslint-react.xyz/docs/rules/no-useless-fragment
3777
+ * @see https://eslint-react.xyz/docs/rules/jsx-no-useless-fragment
3758
3778
  */
3759
3779
  'react/jsx-no-useless-fragment'?: Linter.RuleEntry<ReactJsxNoUselessFragment>;
3760
3780
  /**
3761
- * Enforces the context name to be a valid component name with the suffix 'Context'.
3781
+ * Enforces identifier names assigned from `createContext` calls to be a valid component name with the suffix `Context`.
3762
3782
  * @see https://eslint-react.xyz/docs/rules/naming-convention-context-name
3763
3783
  */
3764
3784
  'react/naming-convention-context-name'?: Linter.RuleEntry<[]>;
@@ -3838,7 +3858,7 @@ interface RuleOptions {
3838
3858
  */
3839
3859
  'react/no-context-provider'?: Linter.RuleEntry<[]>;
3840
3860
  /**
3841
- * Disallows 'createRef' in function components.
3861
+ * Disallows 'createRef' in function components and Hooks.
3842
3862
  * @see https://eslint-react.xyz/docs/rules/no-create-ref
3843
3863
  */
3844
3864
  'react/no-create-ref'?: Linter.RuleEntry<[]>;
@@ -3963,7 +3983,7 @@ interface RuleOptions {
3963
3983
  */
3964
3984
  'react/no-unused-props'?: Linter.RuleEntry<[]>;
3965
3985
  /**
3966
- * Warns about state variables that are defined but never used, or only used in effects.
3986
+ * Warns about state variables that are defined but never used.
3967
3987
  * @see https://eslint-react.xyz/docs/rules/no-unused-state
3968
3988
  */
3969
3989
  'react/no-unused-state'?: Linter.RuleEntry<[]>;
@@ -3984,7 +4004,7 @@ interface RuleOptions {
3984
4004
  'react/refs'?: Linter.RuleEntry<[]>;
3985
4005
  /**
3986
4006
  * Validates and transforms React Client/Server Function definitions.
3987
- * @see https://eslint-react.xyz/docs/rules/function-definition
4007
+ * @see https://eslint-react.xyz/docs/rules/rsc-function-definition
3988
4008
  */
3989
4009
  'react/rsc-function-definition'?: Linter.RuleEntry<[]>;
3990
4010
  /**
@@ -4133,7 +4153,7 @@ interface RuleOptions {
4133
4153
  */
4134
4154
  'react/x-no-context-provider'?: Linter.RuleEntry<[]>;
4135
4155
  /**
4136
- * Disallows 'createRef' in function components.
4156
+ * Disallows 'createRef' in function components and Hooks.
4137
4157
  * @see https://eslint-react.xyz/docs/rules/no-create-ref
4138
4158
  */
4139
4159
  'react/x-no-create-ref'?: Linter.RuleEntry<[]>;
@@ -4258,7 +4278,7 @@ interface RuleOptions {
4258
4278
  */
4259
4279
  'react/x-no-unused-props'?: Linter.RuleEntry<[]>;
4260
4280
  /**
4261
- * Warns about state variables that are defined but never used, or only used in effects.
4281
+ * Warns about state variables that are defined but never used.
4262
4282
  * @see https://eslint-react.xyz/docs/rules/no-unused-state
4263
4283
  */
4264
4284
  'react/x-no-unused-state'?: Linter.RuleEntry<[]>;
@@ -6874,6 +6894,7 @@ type HandleCallbackErr = [] | [string]; // ----- html/attrs-newline -----
6874
6894
  type HtmlAttrsNewline = [] | [{
6875
6895
  closeStyle?: ("newline" | "sameline");
6876
6896
  ifAttrsMoreThan?: number;
6897
+ maxLen?: number;
6877
6898
  skip?: string[];
6878
6899
  inline?: string[];
6879
6900
  }]; // ----- html/element-newline -----
@@ -6969,6 +6990,7 @@ type HtmlRequireOpenGraphProtocol = [] | [string[]]; // ----- html/sort-attrs --
6969
6990
  type HtmlSortAttrs = [] | [{
6970
6991
  priority?: (string | {
6971
6992
  pattern: string;
6993
+ order?: ("preserve" | "alphabetically");
6972
6994
  })[];
6973
6995
  }]; // ----- html/use-baseline -----
6974
6996
  type HtmlUseBaseline = [] | [{
package/dist/index.mjs CHANGED
@@ -1403,7 +1403,7 @@ async function typescript(options = {}) {
1403
1403
  "ts/require-await": "error",
1404
1404
  "ts/restrict-plus-operands": "error",
1405
1405
  "ts/restrict-template-expressions": "error",
1406
- "ts/return-await": ["error", "always"],
1406
+ "ts/return-await": ["error", "in-try-catch"],
1407
1407
  "ts/strict-boolean-expressions": ["error", {
1408
1408
  allowNullableBoolean: true,
1409
1409
  allowNullableString: true
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ncontiero/eslint-config",
3
3
  "type": "module",
4
- "version": "8.2.0",
4
+ "version": "8.2.2",
5
5
  "description": "Nicolas's ESLint config.",
6
6
  "author": {
7
7
  "name": "Nicolas Contiero",
@@ -37,15 +37,15 @@
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "@e18e/eslint-plugin": "^0.4.1",
41
- "@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
42
- "@eslint-react/eslint-plugin": "^5.7.6",
43
- "@eslint/markdown": "^8.0.1",
44
- "@html-eslint/eslint-plugin": "^0.60.0",
45
- "@html-eslint/parser": "^0.60.0",
40
+ "@e18e/eslint-plugin": "^0.5.0",
41
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
42
+ "@eslint-react/eslint-plugin": "^5.8.8",
43
+ "@eslint/markdown": "^8.0.2",
44
+ "@html-eslint/eslint-plugin": "^0.61.0",
45
+ "@html-eslint/parser": "^0.61.0",
46
46
  "@next/eslint-plugin-next": "^16.2.6",
47
- "@typescript-eslint/eslint-plugin": "^8.59.3",
48
- "@typescript-eslint/parser": "^8.59.3",
47
+ "@typescript-eslint/eslint-plugin": "^8.60.0",
48
+ "@typescript-eslint/parser": "^8.60.0",
49
49
  "eslint-config-flat-gitignore": "^2.3.0",
50
50
  "eslint-merge-processors": "^2.0.0",
51
51
  "eslint-plugin-antfu": "^3.2.3",
@@ -53,45 +53,45 @@
53
53
  "eslint-plugin-command": "^3.5.2",
54
54
  "eslint-plugin-de-morgan": "^2.1.2",
55
55
  "eslint-plugin-import-x": "^4.16.2",
56
- "eslint-plugin-jsdoc": "^62.9.0",
57
- "eslint-plugin-jsonc": "^3.1.2",
56
+ "eslint-plugin-jsdoc": "^63.0.0",
57
+ "eslint-plugin-jsonc": "^3.2.0",
58
58
  "eslint-plugin-jsx-a11y": "^6.10.2",
59
59
  "eslint-plugin-n": "^18.0.1",
60
60
  "eslint-plugin-perfectionist": "^5.9.0",
61
- "eslint-plugin-prettier": "^5.5.5",
61
+ "eslint-plugin-prettier": "^5.5.6",
62
62
  "eslint-plugin-promise": "^7.3.0",
63
63
  "eslint-plugin-react-refresh": "^0.5.2",
64
64
  "eslint-plugin-regexp": "^3.1.0",
65
- "eslint-plugin-toml": "^1.3.1",
65
+ "eslint-plugin-toml": "^1.4.0",
66
66
  "eslint-plugin-unicorn": "^64.0.0",
67
67
  "eslint-plugin-unused-imports": "^4.4.1",
68
- "eslint-plugin-yml": "^3.3.2",
68
+ "eslint-plugin-yml": "^3.4.0",
69
69
  "globals": "^17.6.0",
70
- "local-pkg": "^1.1.2",
70
+ "local-pkg": "^1.2.1",
71
71
  "prettier": "^3.8.3",
72
72
  "toml-eslint-parser": "^1.0.3",
73
73
  "yaml-eslint-parser": "^2.0.0"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@changesets/cli": "^2.31.0",
77
- "@commitlint/cli": "^21.0.0",
78
- "@commitlint/config-conventional": "^21.0.0",
79
- "@eslint/config-inspector": "^2.0.1",
80
- "@ncontiero/changelog-github": "^2.1.3",
77
+ "@commitlint/cli": "^21.0.2",
78
+ "@commitlint/config-conventional": "^21.0.2",
79
+ "@eslint/config-inspector": "^3.0.4",
80
+ "@ncontiero/changelog-github": "^2.1.4",
81
81
  "@ncontiero/prettier-config": "^1.0.0",
82
- "@tanstack/eslint-plugin-query": "^5.100.10",
82
+ "@tanstack/eslint-plugin-query": "^5.100.14",
83
83
  "@types/eslint-plugin-jsx-a11y": "^6.10.1",
84
- "@types/node": "^25.7.0",
85
- "eslint": "^10.3.0",
84
+ "@types/node": "^25.9.1",
85
+ "eslint": "^10.4.1",
86
86
  "eslint-typegen": "^2.3.1",
87
87
  "husky": "^9.1.7",
88
88
  "nano-staged": "^1.0.2",
89
- "tinyexec": "^1.1.2",
90
- "tinyglobby": "^0.2.16",
91
- "tsdown": "^0.22.0",
92
- "tsx": "^4.21.0",
89
+ "tinyexec": "^1.2.4",
90
+ "tinyglobby": "^0.2.17",
91
+ "tsdown": "^0.22.1",
92
+ "tsx": "^4.22.4",
93
93
  "typescript": "^6.0.3",
94
- "vitest": "^4.1.6"
94
+ "vitest": "^4.1.7"
95
95
  },
96
96
  "engines": {
97
97
  "node": ">=20.19.0"