@jimmy.codes/eslint-config 6.22.0 → 6.23.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/README.md CHANGED
@@ -99,6 +99,20 @@ Options:
99
99
  - `'implicit'`: Use implicit global APIs (vitest config `globals: true`)
100
100
  - `'either'`: Allow both styles (default)
101
101
 
102
+ #### Configure Type Testing
103
+
104
+ Indicate whether [Vitest's type testing utilities](https://vitest.dev/guide/testing-types.html) (`expectTypeOf`, `assertType`) are being used:
105
+
106
+ ```ts
107
+ import { defineConfig } from "@jimmy.codes/eslint-config";
108
+
109
+ export default defineConfig({
110
+ vitest: {
111
+ typecheck: true,
112
+ },
113
+ });
114
+ ```
115
+
102
116
  ### Override Specific Rules
103
117
 
104
118
  ```ts
@@ -1,4 +1,4 @@
1
- import { t as GLOB_ASTRO } from "./globs-C_yfK842.mjs";
1
+ import { t as GLOB_ASTRO } from "./globs-uKx5b8lV.mjs";
2
2
  import { t as interopDefault } from "./interop-default-Bn64p66u.mjs";
3
3
  import globals from "globals";
4
4
 
@@ -1,10 +1,12 @@
1
1
  //#region src/globs.ts
2
2
  const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
3
+ const GLOB_TS_EXT = "?([cm])ts";
4
+ const GLOB_TSX_EXT = "?([cm])tsx";
3
5
  const GLOB_JS = "**/*.?([cm])js";
4
6
  const GLOB_JSX = "**/*.?([cm])jsx";
5
7
  const GLOB_CJS = "**/*.cjs";
6
- const GLOB_TS = "**/*.?([cm])ts";
7
- const GLOB_TSX = "**/*.?([cm])tsx";
8
+ const GLOB_TS = `**/*.${GLOB_TS_EXT}`;
9
+ const GLOB_TSX = `**/*.${GLOB_TSX_EXT}`;
8
10
  const GLOB_ASTRO = "**/*.astro";
9
11
  const GLOB_TESTS = [
10
12
  `**/__tests__/**/*.${GLOB_SRC_EXT}`,
@@ -13,6 +15,12 @@ const GLOB_TESTS = [
13
15
  `**/*.bench.${GLOB_SRC_EXT}`,
14
16
  `**/*.benchmark.${GLOB_SRC_EXT}`
15
17
  ];
18
+ const GLOB_TYPE_TESTS = [
19
+ `**/*.test-d.${GLOB_TS_EXT}`,
20
+ `**/*.test-d.${GLOB_TSX_EXT}`,
21
+ `**/*.spec-d.${GLOB_TS_EXT}`,
22
+ `**/*.spec-d.${GLOB_TSX_EXT}`
23
+ ];
16
24
  const GLOB_PLAYWRIGHT = [`**/e2e/**/*.spec.${GLOB_SRC_EXT}`, `**/e2e/**/*.test.${GLOB_SRC_EXT}`];
17
25
  const GLOB_E2E = [
18
26
  ...GLOB_PLAYWRIGHT,
@@ -69,4 +77,4 @@ const GLOB_IGNORES = [
69
77
  ];
70
78
 
71
79
  //#endregion
72
- export { GLOB_JS as a, GLOB_PLAYWRIGHT as c, GLOB_TSX as d, GLOB_IGNORES as i, GLOB_TESTS as l, GLOB_CJS as n, GLOB_JSX as o, GLOB_E2E as r, GLOB_NEXTJS as s, GLOB_ASTRO as t, GLOB_TS as u };
80
+ export { GLOB_JS as a, GLOB_PLAYWRIGHT as c, GLOB_TSX as d, GLOB_TYPE_TESTS as f, GLOB_IGNORES as i, GLOB_TESTS as l, GLOB_CJS as n, GLOB_JSX as o, GLOB_E2E as r, GLOB_NEXTJS as s, GLOB_ASTRO as t, GLOB_TS as u };
package/dist/globs.d.mts CHANGED
@@ -6,9 +6,10 @@ declare const GLOB_TS = "**/*.?([cm])ts";
6
6
  declare const GLOB_TSX = "**/*.?([cm])tsx";
7
7
  declare const GLOB_ASTRO = "**/*.astro";
8
8
  declare const GLOB_TESTS: readonly ["**/__tests__/**/*.?([cm])[jt]s?(x)", "**/*.spec.?([cm])[jt]s?(x)", "**/*.test.?([cm])[jt]s?(x)", "**/*.bench.?([cm])[jt]s?(x)", "**/*.benchmark.?([cm])[jt]s?(x)"];
9
+ declare const GLOB_TYPE_TESTS: readonly ["**/*.test-d.?([cm])ts", "**/*.test-d.?([cm])tsx", "**/*.spec-d.?([cm])ts", "**/*.spec-d.?([cm])tsx"];
9
10
  declare const GLOB_PLAYWRIGHT: readonly ["**/e2e/**/*.spec.?([cm])[jt]s?(x)", "**/e2e/**/*.test.?([cm])[jt]s?(x)"];
10
11
  declare const GLOB_E2E: readonly ["**/e2e/**/*.spec.?([cm])[jt]s?(x)", "**/e2e/**/*.test.?([cm])[jt]s?(x)", "**/cypress/**/*.spec.?([cm])[jt]s?(x)", "**/cypress/**/*.test.?([cm])[jt]s?(x)"];
11
12
  declare const GLOB_NEXTJS: readonly ["**/*.?([cm])js", "**/*.?([cm])jsx", "**/*.?([cm])ts", "**/*.?([cm])tsx"];
12
13
  declare const GLOB_IGNORES: readonly ["**/node_modules", "**/dist", "**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml", "**/bun.lockb", "**/output", "**/coverage", "**/temp", "**/.temp", "**/tmp", "**/.tmp", "**/.history", "**/.vitepress/cache", "**/.nuxt", "**/.next", "**/.vercel", "**/.changeset", "**/.idea", "**/.cache", "**/.output", "**/.vite-inspect", "**/.yarn", "**/storybook-static", "**/.eslint-config-inspector", "**/playwright-report", "**/.astro", "**/.vinxi", "**/app.config.timestamp_*.js", "**/.tanstack", "**/.nitro", "**/CHANGELOG*.md", "**/*.min.*", "**/LICENSE*", "**/__snapshots__", "**/auto-import?(s).d.ts", "**/components.d.ts", "**/vite.config.ts.*.mjs", "**/*.gen.*", "!.storybook"];
13
14
  //#endregion
14
- export { GLOB_ASTRO, GLOB_CJS, GLOB_E2E, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_NEXTJS, GLOB_PLAYWRIGHT, GLOB_TESTS, GLOB_TS, GLOB_TSX };
15
+ export { GLOB_ASTRO, GLOB_CJS, GLOB_E2E, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_NEXTJS, GLOB_PLAYWRIGHT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_TYPE_TESTS };
package/dist/globs.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { a as GLOB_JS, c as GLOB_PLAYWRIGHT, d as GLOB_TSX, i as GLOB_IGNORES, l as GLOB_TESTS, n as GLOB_CJS, o as GLOB_JSX, r as GLOB_E2E, s as GLOB_NEXTJS, t as GLOB_ASTRO, u as GLOB_TS } from "./globs-C_yfK842.mjs";
1
+ import { a as GLOB_JS, c as GLOB_PLAYWRIGHT, d as GLOB_TSX, f as GLOB_TYPE_TESTS, i as GLOB_IGNORES, l as GLOB_TESTS, n as GLOB_CJS, o as GLOB_JSX, r as GLOB_E2E, s as GLOB_NEXTJS, t as GLOB_ASTRO, u as GLOB_TS } from "./globs-uKx5b8lV.mjs";
2
2
 
3
- export { GLOB_ASTRO, GLOB_CJS, GLOB_E2E, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_NEXTJS, GLOB_PLAYWRIGHT, GLOB_TESTS, GLOB_TS, GLOB_TSX };
3
+ export { GLOB_ASTRO, GLOB_CJS, GLOB_E2E, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_NEXTJS, GLOB_PLAYWRIGHT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_TYPE_TESTS };
package/dist/index.d.mts CHANGED
@@ -15017,6 +15017,12 @@ interface VitestOptions {
15017
15017
  * @default 'either'
15018
15018
  */
15019
15019
  globals?: "either" | "explicit" | "implicit";
15020
+ /**
15021
+ * Indicate whether [Vitest's type testing utilities](https://vitest.dev/guide/testing-types.html) (`expectTypeOf`, `assertType`) are being used
15022
+ *
15023
+ * @default false
15024
+ */
15025
+ typecheck?: boolean;
15020
15026
  }
15021
15027
  interface Options {
15022
15028
  /**
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as GLOB_IGNORES, l as GLOB_TESTS, n as GLOB_CJS } from "./globs-C_yfK842.mjs";
1
+ import { i as GLOB_IGNORES, l as GLOB_TESTS, n as GLOB_CJS } from "./globs-uKx5b8lV.mjs";
2
2
  import { a as hasReact, c as hasTestingLibrary, d as hasVitest, i as hasPlaywright, l as hasTypescript, n as hasJest, o as hasReactQuery, r as hasNext, s as hasStorybook, t as hasAstro } from "./has-dependency-BreXO1rF.mjs";
3
3
  import gitignoreConfig from "eslint-config-flat-gitignore";
4
4
  import globals from "globals";
@@ -504,16 +504,16 @@ const defineConfig = async ({ astro = false, autoDetect = true, gitignore = fals
504
504
  stylisticConfig()
505
505
  ];
506
506
  const featureConfigs = await Promise.all([
507
- isTypescriptEnabled && unwrap(import("./typescript-w0LuBIDT.mjs")),
508
- isReactEnabled && unwrap(import("./react-sWdvHd_J.mjs")),
509
- isTanstackQueryEnabled && unwrap(import("./tanstack-query-D1gpzKY3.mjs")),
510
- isAstroEnabled && unwrap(import("./astro-D3Zl135N.mjs")),
511
- isJestEnabled && unwrap(import("./jest-DZtYWPoX.mjs")),
512
- isVitestEnabled && unwrap(import("./vitest-oIUtAksi.mjs"), vitest),
513
- isTestingLibraryEnabled && unwrap(import("./testing-library-BBWV3thw.mjs")),
514
- isPlaywrightEnabled && unwrap(import("./playwright-CrBcE3qD.mjs")),
507
+ isTypescriptEnabled && unwrap(import("./typescript-CMkBsIGI.mjs")),
508
+ isReactEnabled && unwrap(import("./react-DY8zODCu.mjs")),
509
+ isTanstackQueryEnabled && unwrap(import("./tanstack-query-DG6a41GH.mjs")),
510
+ isAstroEnabled && unwrap(import("./astro-DNtOkeq5.mjs")),
511
+ isJestEnabled && unwrap(import("./jest-DgTHyrfz.mjs")),
512
+ isVitestEnabled && unwrap(import("./vitest-C4QXivmM.mjs"), vitest),
513
+ isTestingLibraryEnabled && unwrap(import("./testing-library-oE675dT3.mjs")),
514
+ isPlaywrightEnabled && unwrap(import("./playwright-CM4et1Wx.mjs")),
515
515
  isStorybookEnabled && unwrap(import("./storybook-CyxpG33Q.mjs")),
516
- isNextjsEnabled && unwrap(import("./nextjs-DEk_ANZ4.mjs"))
516
+ isNextjsEnabled && unwrap(import("./nextjs-VPeisXpq.mjs"))
517
517
  ]);
518
518
  return [
519
519
  ...gitignore ? [gitignoreConfig({ strict: false })] : [],
@@ -1,4 +1,4 @@
1
- import { l as GLOB_TESTS, r as GLOB_E2E } from "./globs-C_yfK842.mjs";
1
+ import { l as GLOB_TESTS, r as GLOB_E2E } from "./globs-uKx5b8lV.mjs";
2
2
  import { t as interopDefault } from "./interop-default-Bn64p66u.mjs";
3
3
 
4
4
  //#region src/rules/jest.ts
@@ -1,4 +1,4 @@
1
- import { s as GLOB_NEXTJS } from "./globs-C_yfK842.mjs";
1
+ import { s as GLOB_NEXTJS } from "./globs-uKx5b8lV.mjs";
2
2
  import { t as interopDefault } from "./interop-default-Bn64p66u.mjs";
3
3
  import { t as upwarn } from "./upwarn-BWFMaOyK.mjs";
4
4
 
@@ -1,4 +1,4 @@
1
- import { c as GLOB_PLAYWRIGHT } from "./globs-C_yfK842.mjs";
1
+ import { c as GLOB_PLAYWRIGHT } from "./globs-uKx5b8lV.mjs";
2
2
  import { t as interopDefault } from "./interop-default-Bn64p66u.mjs";
3
3
 
4
4
  //#region src/rules/playwright.ts
@@ -1,4 +1,4 @@
1
- import { d as GLOB_TSX, o as GLOB_JSX } from "./globs-C_yfK842.mjs";
1
+ import { d as GLOB_TSX, o as GLOB_JSX } from "./globs-uKx5b8lV.mjs";
2
2
  import { l as hasTypescript, r as hasNext, u as hasVite } from "./has-dependency-BreXO1rF.mjs";
3
3
  import { t as interopDefault } from "./interop-default-Bn64p66u.mjs";
4
4
  import { t as upwarn } from "./upwarn-BWFMaOyK.mjs";
@@ -1,4 +1,4 @@
1
- import { d as GLOB_TSX, o as GLOB_JSX } from "./globs-C_yfK842.mjs";
1
+ import { d as GLOB_TSX, o as GLOB_JSX } from "./globs-uKx5b8lV.mjs";
2
2
  import { t as interopDefault } from "./interop-default-Bn64p66u.mjs";
3
3
 
4
4
  //#region src/configs/tanstack-query.ts
@@ -1,4 +1,4 @@
1
- import { l as GLOB_TESTS, r as GLOB_E2E } from "./globs-C_yfK842.mjs";
1
+ import { l as GLOB_TESTS, r as GLOB_E2E } from "./globs-uKx5b8lV.mjs";
2
2
  import { t as interopDefault } from "./interop-default-Bn64p66u.mjs";
3
3
 
4
4
  //#region src/rules/testing-library.ts
@@ -1,4 +1,4 @@
1
- import { a as GLOB_JS, l as GLOB_TESTS, o as GLOB_JSX } from "./globs-C_yfK842.mjs";
1
+ import { a as GLOB_JS, l as GLOB_TESTS, o as GLOB_JSX } from "./globs-uKx5b8lV.mjs";
2
2
 
3
3
  //#region src/rules/typescript.ts
4
4
  const disabledEslintRules = {
@@ -1,4 +1,4 @@
1
- import { l as GLOB_TESTS, r as GLOB_E2E } from "./globs-C_yfK842.mjs";
1
+ import { f as GLOB_TYPE_TESTS, l as GLOB_TESTS, r as GLOB_E2E } from "./globs-uKx5b8lV.mjs";
2
2
  import { t as interopDefault } from "./interop-default-Bn64p66u.mjs";
3
3
 
4
4
  //#region src/rules/vitest.ts
@@ -80,11 +80,12 @@ async function vitestConfig(options) {
80
80
  const vitestPlugin = await interopDefault(import("@vitest/eslint-plugin"));
81
81
  const extractedOptions = extractOptions(options);
82
82
  return [{
83
- files: GLOB_TESTS,
83
+ files: [...GLOB_TESTS, ...extractedOptions?.typecheck ? GLOB_TYPE_TESTS : []],
84
84
  ignores: GLOB_E2E,
85
85
  ...vitestPlugin.configs.recommended,
86
86
  name: "jimmy.codes/vitest",
87
- rules: await vitestRules(extractedOptions)
87
+ rules: await vitestRules(extractedOptions),
88
+ settings: { vitest: { typecheck: extractedOptions?.typecheck ?? false } }
88
89
  }];
89
90
  }
90
91
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimmy.codes/eslint-config",
3
- "version": "6.22.0",
3
+ "version": "6.23.0",
4
4
  "description": "A simple, modern ESLint config that covers most use cases.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -63,13 +63,13 @@
63
63
  "eslint-plugin-perfectionist": "^4.15.1",
64
64
  "eslint-plugin-playwright": "^2.3.0",
65
65
  "eslint-plugin-react-compiler": "19.1.0-rc.2",
66
- "eslint-plugin-react-dom": "^2.3.7",
66
+ "eslint-plugin-react-dom": "^2.3.9",
67
67
  "eslint-plugin-react-hooks": "^7.0.1",
68
- "eslint-plugin-react-hooks-extra": "^2.3.7",
69
- "eslint-plugin-react-naming-convention": "^2.3.7",
68
+ "eslint-plugin-react-hooks-extra": "^2.3.9",
69
+ "eslint-plugin-react-naming-convention": "^2.3.9",
70
70
  "eslint-plugin-react-refresh": "0.4.24",
71
- "eslint-plugin-react-web-api": "^2.3.7",
72
- "eslint-plugin-react-x": "^2.3.7",
71
+ "eslint-plugin-react-web-api": "^2.3.9",
72
+ "eslint-plugin-react-x": "^2.3.9",
73
73
  "eslint-plugin-regexp": "^2.10.0",
74
74
  "eslint-plugin-storybook": "0.12.0",
75
75
  "eslint-plugin-testing-library": "^7.13.5",