@jimmy.codes/eslint-config 6.13.3 → 6.14.1

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.ts CHANGED
@@ -1536,7 +1536,7 @@ interface RuleOptions {
1536
1536
  * Disallow member access on a value with type `any`
1537
1537
  * @see https://typescript-eslint.io/rules/no-unsafe-member-access
1538
1538
  */
1539
- '@typescript-eslint/no-unsafe-member-access'?: Linter.RuleEntry<[]>;
1539
+ '@typescript-eslint/no-unsafe-member-access'?: Linter.RuleEntry<TypescriptEslintNoUnsafeMemberAccess>;
1540
1540
  /**
1541
1541
  * Disallow returning a value with type `any` from a function
1542
1542
  * @see https://typescript-eslint.io/rules/no-unsafe-return
@@ -3271,6 +3271,26 @@ interface RuleOptions {
3271
3271
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/text-escaping.md#repos-sticky-header
3272
3272
  */
3273
3273
  'jsdoc/text-escaping'?: Linter.RuleEntry<JsdocTextEscaping>;
3274
+ /**
3275
+ * Prefers either function properties or method signatures
3276
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-method-signature-style.md#repos-sticky-header
3277
+ */
3278
+ 'jsdoc/ts-method-signature-style'?: Linter.RuleEntry<JsdocTsMethodSignatureStyle>;
3279
+ /**
3280
+ * Warns against use of the empty object type
3281
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-no-empty-object-type.md#repos-sticky-header
3282
+ */
3283
+ 'jsdoc/ts-no-empty-object-type'?: Linter.RuleEntry<[]>;
3284
+ /**
3285
+ * Catches unnecessary template expressions such as string expressions within a template literal.
3286
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-no-unnecessary-template-expression.md#repos-sticky-header
3287
+ */
3288
+ 'jsdoc/ts-no-unnecessary-template-expression'?: Linter.RuleEntry<JsdocTsNoUnnecessaryTemplateExpression>;
3289
+ /**
3290
+ * Prefers function types over call signatures when there are no other properties.
3291
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-prefer-function-type.md#repos-sticky-header
3292
+ */
3293
+ 'jsdoc/ts-prefer-function-type'?: Linter.RuleEntry<JsdocTsPreferFunctionType>;
3274
3294
  /**
3275
3295
  * Formats JSDoc type values.
3276
3296
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/type-formatting.md#repos-sticky-header
@@ -5261,6 +5281,10 @@ interface RuleOptions {
5261
5281
  * Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
5262
5282
  */
5263
5283
  'react-hooks/use-memo'?: Linter.RuleEntry<ReactHooksUseMemo>;
5284
+ /**
5285
+ * Validates that useMemos always return a value. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
5286
+ */
5287
+ 'react-hooks/void-use-memo'?: Linter.RuleEntry<ReactHooksVoidUseMemo>;
5264
5288
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>;
5265
5289
  /**
5266
5290
  * disallow confusing quantifiers
@@ -6739,7 +6763,7 @@ interface RuleOptions {
6739
6763
  */
6740
6764
  'vars-on-top'?: Linter.RuleEntry<[]>;
6741
6765
  /**
6742
- * require .spec test file pattern
6766
+ * require test file pattern
6743
6767
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
6744
6768
  */
6745
6769
  'vitest/consistent-test-filename'?: Linter.RuleEntry<VitestConsistentTestFilename>;
@@ -7189,7 +7213,6 @@ type EslintReactNoForbiddenProps = [] | [{
7189
7213
  includedNodes?: string[];
7190
7214
  prop: string;
7191
7215
  })[];
7192
- [k: string]: unknown | undefined;
7193
7216
  }];
7194
7217
  // ----- @eslint-react/no-useless-fragment -----
7195
7218
  type EslintReactNoUselessFragment = [] | [{
@@ -9087,6 +9110,10 @@ type TypescriptEslintNoUnnecessaryTypeAssertion = [] | [{
9087
9110
  checkLiteralConstAssertions?: boolean;
9088
9111
  typesToIgnore?: string[];
9089
9112
  }];
9113
+ // ----- @typescript-eslint/no-unsafe-member-access -----
9114
+ type TypescriptEslintNoUnsafeMemberAccess = [] | [{
9115
+ allowOptionalChaining?: boolean;
9116
+ }];
9090
9117
  // ----- @typescript-eslint/no-unused-expressions -----
9091
9118
  type TypescriptEslintNoUnusedExpressions = [] | [{
9092
9119
  allowShortCircuit?: boolean;
@@ -9104,6 +9131,7 @@ type TypescriptEslintNoUnusedVars = [] | [(("all" | "local") | {
9104
9131
  destructuredArrayIgnorePattern?: string;
9105
9132
  ignoreClassWithStaticInitBlock?: boolean;
9106
9133
  ignoreRestSiblings?: boolean;
9134
+ ignoreUsingDeclarations?: boolean;
9107
9135
  reportUsedIgnorePattern?: boolean;
9108
9136
  vars?: ("all" | "local");
9109
9137
  varsIgnorePattern?: string;
@@ -10644,16 +10672,44 @@ type JsdocTextEscaping = [] | [{
10644
10672
  escapeHTML?: boolean;
10645
10673
  escapeMarkdown?: boolean;
10646
10674
  }];
10675
+ // ----- jsdoc/ts-method-signature-style -----
10676
+ type JsdocTsMethodSignatureStyle = [] | [("method" | "property")] | [("method" | "property"), {
10677
+ enableFixer?: boolean;
10678
+ }];
10679
+ // ----- jsdoc/ts-no-unnecessary-template-expression -----
10680
+ type JsdocTsNoUnnecessaryTemplateExpression = [] | [{
10681
+ enableFixer?: boolean;
10682
+ }];
10683
+ // ----- jsdoc/ts-prefer-function-type -----
10684
+ type JsdocTsPreferFunctionType = [] | [{
10685
+ enableFixer?: boolean;
10686
+ }];
10647
10687
  // ----- jsdoc/type-formatting -----
10648
10688
  type JsdocTypeFormatting = [] | [{
10649
10689
  arrayBrackets?: ("angle" | "square");
10690
+ arrowFunctionPostReturnMarkerSpacing?: string;
10691
+ arrowFunctionPreReturnMarkerSpacing?: string;
10650
10692
  enableFixer?: boolean;
10693
+ functionOrClassParameterSpacing?: string;
10694
+ functionOrClassPostGenericSpacing?: string;
10695
+ functionOrClassPostReturnMarkerSpacing?: string;
10696
+ functionOrClassPreReturnMarkerSpacing?: string;
10697
+ functionOrClassTypeParameterSpacing?: string;
10698
+ genericAndTupleElementSpacing?: string;
10651
10699
  genericDot?: boolean;
10700
+ keyValuePostColonSpacing?: string;
10701
+ keyValuePostKeySpacing?: string;
10702
+ keyValuePostOptionalSpacing?: string;
10703
+ keyValuePostVariadicSpacing?: string;
10704
+ methodQuotes?: ("double" | "single");
10652
10705
  objectFieldIndent?: string;
10653
10706
  objectFieldQuote?: ("double" | "single" | null);
10654
10707
  objectFieldSeparator?: ("comma" | "comma-and-linebreak" | "linebreak" | "semicolon" | "semicolon-and-linebreak");
10655
10708
  objectFieldSeparatorOptionalLinebreak?: boolean;
10656
10709
  objectFieldSeparatorTrailingPunctuation?: boolean;
10710
+ parameterDefaultValueSpacing?: string;
10711
+ postMethodNameSpacing?: string;
10712
+ postNewSpacing?: string;
10657
10713
  separatorForSingleObjectField?: boolean;
10658
10714
  stringQuotes?: ("double" | "single");
10659
10715
  typeBracketSpacing?: string;
@@ -14119,6 +14175,10 @@ type ReactHooksUnsupportedSyntax = [] | [{
14119
14175
  type ReactHooksUseMemo = [] | [{
14120
14176
  [k: string]: unknown | undefined;
14121
14177
  }];
14178
+ // ----- react-hooks/void-use-memo -----
14179
+ type ReactHooksVoidUseMemo = [] | [{
14180
+ [k: string]: unknown | undefined;
14181
+ }];
14122
14182
  // ----- react-refresh/only-export-components -----
14123
14183
  type ReactRefreshOnlyExportComponents = [] | [{
14124
14184
  allowExportNames?: string[];
package/dist/index.js CHANGED
@@ -484,15 +484,15 @@ const defineConfig = async ({ astro = false, autoDetect = true, gitignore = fals
484
484
  ];
485
485
  const featureConfigs = await Promise.all([
486
486
  isTypescriptEnabled && unwrap(import("./typescript-D8AT5dEv.js")),
487
- isReactEnabled && unwrap(import("./react-By-ZN_z5.js")),
487
+ isReactEnabled && unwrap(import("./react-BnGlxfxv.js")),
488
488
  isTanstackQueryEnabled && unwrap(import("./tanstack-query-DqqVfxJs.js")),
489
489
  isAstroEnabled && unwrap(import("./astro-Cc3Rxusf.js")),
490
- isJestEnabled && unwrap(import("./jest-G-dRTY_j.js")),
491
- isVitestEnabled && unwrap(import("./vitest-BP2VqxKz.js")),
490
+ isJestEnabled && unwrap(import("./jest-BCatBVvc.js")),
491
+ isVitestEnabled && unwrap(import("./vitest-CADaM8FX.js")),
492
492
  isTestingLibraryEnabled && unwrap(import("./testing-library-lJsmjyFo.js")),
493
493
  isPlaywrightEnabled && unwrap(import("./playwright-Bbcb5Jsi.js")),
494
494
  isStorybookEnabled && unwrap(import("./storybook-BO4plVPp.js")),
495
- isNextjsEnabled && unwrap(import("./nextjs-X6g9xH_I.js"))
495
+ isNextjsEnabled && unwrap(import("./nextjs-Dw-jYP2k.js"))
496
496
  ]);
497
497
  return [
498
498
  ...gitignore ? [gitignoreConfig({ strict: false })] : [],
@@ -50,11 +50,10 @@ const jestRules = async () => {
50
50
  //#endregion
51
51
  //#region src/configs/jest.ts
52
52
  async function jestConfig() {
53
- const jestPlugin = await interopDefault(import("eslint-plugin-jest"));
54
53
  return [{
55
54
  files: GLOB_TESTS,
56
55
  ignores: GLOB_E2E,
57
- ...jestPlugin.configs["flat/recommended"],
56
+ ...(await interopDefault(import("eslint-plugin-jest"))).configs["flat/recommended"],
58
57
  name: "jimmy.codes/jest",
59
58
  rules: await jestRules()
60
59
  }];
@@ -4,8 +4,7 @@ import { upwarn } from "./upwarn-C7t3ub-R.js";
4
4
 
5
5
  //#region src/rules/nextjs.ts
6
6
  const nextjsRules = async () => {
7
- const nextjsPlugin = await interopDefault(import("@next/eslint-plugin-next"));
8
- return upwarn(nextjsPlugin.configs.recommended.rules);
7
+ return upwarn((await interopDefault(import("@next/eslint-plugin-next"))).configs.recommended.rules);
9
8
  };
10
9
 
11
10
  //#endregion
@@ -24,11 +24,14 @@ const reactRules = async () => {
24
24
  const [{ configs: reactConfigs }, jsxA11yPlugin] = await Promise.all([interopDefault(import("@eslint-react/eslint-plugin")), interopDefault(import("eslint-plugin-jsx-a11y"))]);
25
25
  const isUsingNextjs = hasNext();
26
26
  const isUsingVite = hasVite();
27
- const reactPluginRules = hasTypescript() ? reactConfigs["recommended-type-checked"].rules : reactConfigs.recommended.rules;
27
+ const reactPluginRules = hasTypescript() ? reactConfigs["strict-type-checked"].rules : reactConfigs.recommended.rules;
28
28
  return {
29
29
  ...jsxA11yPlugin.flatConfigs.recommended.rules,
30
30
  ...upwarn(reactPluginRules),
31
+ "@eslint-react/dom/no-missing-button-type": "error",
32
+ "@eslint-react/dom/no-missing-iframe-sandbox": "error",
31
33
  "@eslint-react/dom/no-string-style-prop": "error",
34
+ "@eslint-react/dom/no-unsafe-target-blank": "error",
32
35
  "@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "off",
33
36
  "@eslint-react/jsx-key-before-spread": "error",
34
37
  "@eslint-react/jsx-shorthand-boolean": "error",
@@ -40,6 +43,9 @@ const reactRules = async () => {
40
43
  "@eslint-react/no-unnecessary-key": "error",
41
44
  "@eslint-react/no-unnecessary-use-callback": "error",
42
45
  "@eslint-react/no-unnecessary-use-memo": "error",
46
+ "@eslint-react/no-unstable-context-value": "error",
47
+ "@eslint-react/no-unstable-default-props": "error",
48
+ "@eslint-react/no-unused-state": "error",
43
49
  "@eslint-react/no-useless-fragment": "error",
44
50
  "@eslint-react/prefer-namespace-import": "error",
45
51
  "react-compiler/react-compiler": "error",
@@ -58,6 +64,7 @@ const reactRules = async () => {
58
64
  "react-hooks/static-components": "error",
59
65
  "react-hooks/unsupported-syntax": "error",
60
66
  "react-hooks/use-memo": "error",
67
+ "react-hooks/void-use-memo": "error",
61
68
  "react-refresh/only-export-components": ["warn", {
62
69
  allowConstantExport: isUsingVite,
63
70
  allowExportNames: isUsingNextjs ? nextAllowedExportNames : []
@@ -64,11 +64,10 @@ const vitestRules = async () => {
64
64
  //#endregion
65
65
  //#region src/configs/vitest.ts
66
66
  async function vitestConfig() {
67
- const vitestPlugin = await interopDefault(import("@vitest/eslint-plugin"));
68
67
  return [{
69
68
  files: GLOB_TESTS,
70
69
  ignores: GLOB_E2E,
71
- ...vitestPlugin.configs.recommended,
70
+ ...(await interopDefault(import("@vitest/eslint-plugin"))).configs.recommended,
72
71
  name: "jimmy.codes/vitest",
73
72
  rules: await vitestRules()
74
73
  }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimmy.codes/eslint-config",
3
- "version": "6.13.3",
3
+ "version": "6.14.1",
4
4
  "description": "A simple, modern ESLint config that covers most use cases.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -40,15 +40,15 @@
40
40
  ],
41
41
  "dependencies": {
42
42
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
43
- "@eslint-react/eslint-plugin": "^2.0.6",
43
+ "@eslint-react/eslint-plugin": "2.2.1",
44
44
  "@eslint/js": "^9.37.0",
45
- "@next/eslint-plugin-next": "^15.5.4",
45
+ "@next/eslint-plugin-next": "^15.5.5",
46
46
  "@stylistic/eslint-plugin": "^5.4.0",
47
47
  "@tanstack/eslint-plugin-query": "^5.91.0",
48
48
  "@types/eslint": "9.6.1",
49
- "@typescript-eslint/parser": "^8.45.0",
50
- "@typescript-eslint/utils": "^8.45.0",
51
- "@vitest/eslint-plugin": "^1.3.16",
49
+ "@typescript-eslint/parser": "^8.46.1",
50
+ "@typescript-eslint/utils": "^8.46.1",
51
+ "@vitest/eslint-plugin": "^1.3.20",
52
52
  "astro-eslint-parser": "^1.2.2",
53
53
  "eslint-config-flat-gitignore": "^2.1.0",
54
54
  "eslint-config-prettier": "^10.1.8",
@@ -57,21 +57,21 @@
57
57
  "eslint-plugin-import-x": "^4.16.1",
58
58
  "eslint-plugin-jest": "^29.0.1",
59
59
  "eslint-plugin-jest-dom": "^5.5.0",
60
- "eslint-plugin-jsdoc": "^60.8.1",
60
+ "eslint-plugin-jsdoc": "^61.1.2",
61
61
  "eslint-plugin-jsx-a11y": "^6.10.2",
62
62
  "eslint-plugin-n": "^17.23.1",
63
63
  "eslint-plugin-perfectionist": "^4.15.1",
64
64
  "eslint-plugin-playwright": "^2.2.2",
65
65
  "eslint-plugin-react-compiler": "19.1.0-rc.2",
66
- "eslint-plugin-react-hooks": "^6.1.1",
66
+ "eslint-plugin-react-hooks": "^7.0.0",
67
67
  "eslint-plugin-react-refresh": "0.4.23",
68
68
  "eslint-plugin-regexp": "^2.10.0",
69
69
  "eslint-plugin-storybook": "0.12.0",
70
- "eslint-plugin-testing-library": "^7.11.0",
70
+ "eslint-plugin-testing-library": "^7.13.3",
71
71
  "eslint-plugin-unicorn": "^61.0.2",
72
72
  "globals": "^16.4.0",
73
73
  "local-pkg": "^1.1.2",
74
- "typescript-eslint": "^8.45.0"
74
+ "typescript-eslint": "^8.46.1"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "eslint": "^9.10.0"