@jimmy.codes/eslint-config 6.0.0 → 6.1.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.
@@ -0,0 +1,17 @@
1
+ //#region src/utils/interop-default.ts
2
+ /**
3
+ * Utility to safely fetch an imported `ESLint` plugin.
4
+ *
5
+ * Since ESLint Flat Config still isn't widely adopted, many plugins don't include types or a default import by default. Additionally, since we accept large version ranges in our peer dependencies, the structure of plugins may change at times. This function normalizes an import of a generic ESLint plugin, ensuring it is typed and accessible.
6
+ *
7
+ * @param module the result of `import('eslint-plugin-name')`.
8
+ *
9
+ * @returns The normalized and awaited default export.
10
+ */
11
+ const interopDefault = async (module) => {
12
+ const resolved = await module;
13
+ return resolved?.default ?? resolved;
14
+ };
15
+
16
+ //#endregion
17
+ export { interopDefault };
@@ -0,0 +1,62 @@
1
+ import { GLOB_E2E, GLOB_TESTS } from "./constants-dep165g5.js";
2
+ import { interopDefault } from "./interop-default-D4l3hsYQ.js";
3
+
4
+ //#region src/rules/jest.ts
5
+ const jestRules = async () => {
6
+ const jestPlugin = await interopDefault(import("eslint-plugin-jest"));
7
+ return {
8
+ ...jestPlugin.configs["flat/recommended"].rules,
9
+ ...jestPlugin.configs["flat/style"].rules,
10
+ "jest/consistent-test-it": ["error", {
11
+ fn: "test",
12
+ withinDescribe: "it"
13
+ }],
14
+ "jest/expect-expect": "error",
15
+ "jest/no-alias-methods": "error",
16
+ "jest/no-commented-out-tests": "error",
17
+ "jest/no-conditional-in-test": "error",
18
+ "jest/no-confusing-set-timeout": "error",
19
+ "jest/no-duplicate-hooks": "error",
20
+ "jest/no-hooks": "off",
21
+ "jest/no-large-snapshots": "off",
22
+ "jest/no-restricted-jest-methods": "off",
23
+ "jest/no-restricted-matchers": "off",
24
+ "jest/no-test-return-statement": "error",
25
+ "jest/no-untyped-mock-factory": "off",
26
+ "jest/prefer-called-with": "error",
27
+ "jest/prefer-comparison-matcher": "error",
28
+ "jest/prefer-each": "error",
29
+ "jest/prefer-equality-matcher": "error",
30
+ "jest/prefer-expect-assertions": "off",
31
+ "jest/prefer-expect-resolves": "error",
32
+ "jest/prefer-hooks-in-order": "error",
33
+ "jest/prefer-hooks-on-top": "error",
34
+ "jest/prefer-lowercase-title": "off",
35
+ "jest/prefer-mock-promise-shorthand": "error",
36
+ "jest/prefer-snapshot-hint": "error",
37
+ "jest/prefer-spy-on": "off",
38
+ "jest/prefer-strict-equal": "error",
39
+ "jest/prefer-todo": "warn",
40
+ "jest/require-hook": "error",
41
+ "jest/require-to-throw-message": "error",
42
+ "jest/require-top-level-describe": "off",
43
+ "jest/unbound-method": "off",
44
+ "jest/valid-title": ["error", { mustMatch: { it: "^should" } }]
45
+ };
46
+ };
47
+
48
+ //#endregion
49
+ //#region src/configs/jest.ts
50
+ async function jestConfig() {
51
+ const jestPlugin = await interopDefault(import("eslint-plugin-jest"));
52
+ return [{
53
+ files: GLOB_TESTS,
54
+ ignores: GLOB_E2E,
55
+ ...jestPlugin.configs["flat/recommended"],
56
+ name: "jimmy.codes/jest",
57
+ rules: await jestRules()
58
+ }];
59
+ }
60
+
61
+ //#endregion
62
+ export { jestConfig as default };
@@ -0,0 +1,24 @@
1
+ import { GLOB_NEXTJS } from "./constants-dep165g5.js";
2
+ import { interopDefault } from "./interop-default-D4l3hsYQ.js";
3
+ import { upwarn } from "./upwarn-C7t3ub-R.js";
4
+
5
+ //#region src/rules/nextjs.ts
6
+ const nextjsRules = async () => {
7
+ const nextjsPlugin = await interopDefault(import("@next/eslint-plugin-next"));
8
+ return upwarn(nextjsPlugin.configs.recommended.rules);
9
+ };
10
+
11
+ //#endregion
12
+ //#region src/configs/nextjs.ts
13
+ async function nextjsConfig() {
14
+ const nextjsPlugin = await interopDefault(import("@next/eslint-plugin-next"));
15
+ return [{
16
+ files: GLOB_NEXTJS,
17
+ name: "jimmy.codes/nextjs",
18
+ plugins: { "@next/next": nextjsPlugin },
19
+ rules: await nextjsRules()
20
+ }];
21
+ }
22
+
23
+ //#endregion
24
+ export { nextjsConfig as default };
@@ -0,0 +1,41 @@
1
+ import { GLOB_PLAYWRIGHT } from "./constants-dep165g5.js";
2
+ import { interopDefault } from "./interop-default-D4l3hsYQ.js";
3
+
4
+ //#region src/rules/playwright.ts
5
+ const playwrightRules = async () => {
6
+ const playwrightPlugin = await interopDefault(import("eslint-plugin-playwright"));
7
+ return {
8
+ ...playwrightPlugin.configs["flat/recommended"].rules,
9
+ "playwright/expect-expect": "error",
10
+ "playwright/max-nested-describe": "error",
11
+ "playwright/no-conditional-expect": "error",
12
+ "playwright/no-conditional-in-test": "error",
13
+ "playwright/no-element-handle": "error",
14
+ "playwright/no-eval": "error",
15
+ "playwright/no-force-option": "error",
16
+ "playwright/no-nested-step": "error",
17
+ "playwright/no-page-pause": "error",
18
+ "playwright/no-skipped-test": "error",
19
+ "playwright/no-slowed-test": "error",
20
+ "playwright/no-useless-await": "error",
21
+ "playwright/no-useless-not": "error",
22
+ "playwright/no-wait-for-selector": "error",
23
+ "playwright/no-wait-for-timeout": "error",
24
+ "playwright/valid-title": "off"
25
+ };
26
+ };
27
+
28
+ //#endregion
29
+ //#region src/configs/playwright.ts
30
+ async function playwrightConfig() {
31
+ const playwrightPlugin = await interopDefault(import("eslint-plugin-playwright"));
32
+ return [{
33
+ ...playwrightPlugin.configs["flat/recommended"],
34
+ files: GLOB_PLAYWRIGHT,
35
+ name: "jimmy.codes/playwright",
36
+ rules: await playwrightRules()
37
+ }];
38
+ }
39
+
40
+ //#endregion
41
+ export { playwrightConfig as default };
@@ -0,0 +1,92 @@
1
+ import { GLOB_JSX, GLOB_TSX } from "./constants-dep165g5.js";
2
+ import { hasNext, hasTypescript, hasVite } from "./has-dependency-B3Fi8OzA.js";
3
+ import { interopDefault } from "./interop-default-D4l3hsYQ.js";
4
+ import { upwarn } from "./upwarn-C7t3ub-R.js";
5
+ import globals from "globals";
6
+
7
+ //#region src/rules/react.ts
8
+ const nextAllowedExportNames = [
9
+ "dynamic",
10
+ "dynamicParams",
11
+ "revalidate",
12
+ "fetchCache",
13
+ "runtime",
14
+ "preferredRegion",
15
+ "maxDuration",
16
+ "config",
17
+ "generateStaticParams",
18
+ "metadata",
19
+ "generateMetadata",
20
+ "viewport",
21
+ "generateViewport"
22
+ ];
23
+ const reactRules = async () => {
24
+ const [{ configs: reactConfigs }, jsxA11yPlugin] = await Promise.all([interopDefault(import("@eslint-react/eslint-plugin")), interopDefault(import("eslint-plugin-jsx-a11y"))]);
25
+ const isUsingNextjs = hasNext();
26
+ const isUsingVite = hasVite();
27
+ const isUsingTypesScript = hasTypescript();
28
+ const reactPluginRules = isUsingTypesScript ? reactConfigs["recommended-type-checked"].rules : reactConfigs.recommended.rules;
29
+ return {
30
+ ...jsxA11yPlugin.configs.recommended.rules,
31
+ ...upwarn(reactPluginRules),
32
+ "@eslint-react/avoid-shorthand-boolean": "off",
33
+ "@eslint-react/avoid-shorthand-fragment": "off",
34
+ "@eslint-react/hooks-extra/no-unnecessary-use-callback": "error",
35
+ "@eslint-react/hooks-extra/no-unnecessary-use-memo": "error",
36
+ "@eslint-react/hooks-extra/no-unnecessary-use-prefix": "error",
37
+ "@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "error",
38
+ "@eslint-react/no-children-prop": "error",
39
+ "@eslint-react/no-complex-conditional-rendering": "error",
40
+ "@eslint-react/no-useless-fragment": "error",
41
+ "@eslint-react/prefer-react-namespace-import": "error",
42
+ "@eslint-react/prefer-shorthand-boolean": "error",
43
+ "@eslint-react/prefer-shorthand-fragment": "error",
44
+ "react-compiler/react-compiler": "error",
45
+ "react-hooks/exhaustive-deps": "error",
46
+ "react-hooks/rules-of-hooks": "error",
47
+ "react-refresh/only-export-components": ["warn", {
48
+ allowConstantExport: isUsingVite,
49
+ allowExportNames: isUsingNextjs ? nextAllowedExportNames : []
50
+ }]
51
+ };
52
+ };
53
+
54
+ //#endregion
55
+ //#region src/configs/react.ts
56
+ async function reactConfig() {
57
+ const [reactPlugin, jsxA11yPlugin, reactHooksPlugin, reactRefreshPlugin, reactCompilerPlugin] = await Promise.all([
58
+ interopDefault(import("@eslint-react/eslint-plugin")),
59
+ interopDefault(import("eslint-plugin-jsx-a11y")),
60
+ import("eslint-plugin-react-hooks"),
61
+ interopDefault(import("eslint-plugin-react-refresh")),
62
+ import("eslint-plugin-react-compiler")
63
+ ]);
64
+ const reactPlugins = reactPlugin.configs.all.plugins;
65
+ return [{
66
+ files: [GLOB_JSX, GLOB_TSX],
67
+ languageOptions: {
68
+ globals: { ...globals.browser },
69
+ parserOptions: {
70
+ ecmaFeatures: { jsx: true },
71
+ jsxPragma: null
72
+ }
73
+ },
74
+ name: "jimmy.codes/react",
75
+ plugins: {
76
+ "@eslint-react": reactPlugins["@eslint-react"],
77
+ "@eslint-react/dom": reactPlugins["@eslint-react/dom"],
78
+ "@eslint-react/hooks-extra": reactPlugins["@eslint-react/hooks-extra"],
79
+ "@eslint-react/naming-convention": reactPlugins["@eslint-react/naming-convention"],
80
+ "@eslint-react/web-api": reactPlugins["@eslint-react/web-api"],
81
+ "jsx-a11y": jsxA11yPlugin,
82
+ "react-compiler": reactCompilerPlugin,
83
+ "react-hooks": reactHooksPlugin,
84
+ "react-refresh": reactRefreshPlugin
85
+ },
86
+ rules: await reactRules(),
87
+ settings: { react: { version: "detect" } }
88
+ }];
89
+ }
90
+
91
+ //#endregion
92
+ export { reactConfig as default };
@@ -0,0 +1,32 @@
1
+ import { interopDefault } from "./interop-default-D4l3hsYQ.js";
2
+ import { upwarn } from "./upwarn-C7t3ub-R.js";
3
+
4
+ //#region src/configs/storybook.ts
5
+ async function storybookConfig() {
6
+ const { configs } = await interopDefault(import("eslint-plugin-storybook"));
7
+ const [setup, storiesConfig, mainConfig] = configs["flat/recommended"];
8
+ return [
9
+ {
10
+ name: "jimmy.codes/storybook/setup",
11
+ plugins: setup?.plugins
12
+ },
13
+ {
14
+ files: storiesConfig?.files,
15
+ name: "jimmy.codes/storybook/stories-rules",
16
+ rules: {
17
+ ...upwarn(storiesConfig?.rules),
18
+ "import-x/no-anonymous-default-export": "off",
19
+ "storybook/meta-satisfies-type": "error",
20
+ "unicorn/no-anonymous-default-export": "off"
21
+ }
22
+ },
23
+ {
24
+ files: mainConfig?.files,
25
+ name: "jimmy.codes/storybook/main-rules",
26
+ rules: { ...mainConfig?.rules }
27
+ }
28
+ ];
29
+ }
30
+
31
+ //#endregion
32
+ export { storybookConfig as default };
@@ -0,0 +1,24 @@
1
+ import { GLOB_JSX, GLOB_TSX } from "./constants-dep165g5.js";
2
+ import { interopDefault } from "./interop-default-D4l3hsYQ.js";
3
+
4
+ //#region src/configs/tanstack-query.ts
5
+ async function tanstackQueryConfig() {
6
+ const queryPlugin = await interopDefault(import("@tanstack/eslint-plugin-query"));
7
+ return [{
8
+ files: [GLOB_JSX, GLOB_TSX],
9
+ name: "jimmy.codes/tanstack/react-query",
10
+ plugins: { "@tanstack/query": queryPlugin },
11
+ rules: {
12
+ "@tanstack/query/exhaustive-deps": "error",
13
+ "@tanstack/query/infinite-query-property-order": "error",
14
+ "@tanstack/query/mutation-property-order": "error",
15
+ "@tanstack/query/no-rest-destructuring": "error",
16
+ "@tanstack/query/no-unstable-deps": "error",
17
+ "@tanstack/query/no-void-query-fn": "error",
18
+ "@tanstack/query/stable-query-client": "error"
19
+ }
20
+ }];
21
+ }
22
+
23
+ //#endregion
24
+ export { tanstackQueryConfig as default };
@@ -0,0 +1,31 @@
1
+ import { GLOB_E2E, GLOB_TESTS } from "./constants-dep165g5.js";
2
+ import { interopDefault } from "./interop-default-D4l3hsYQ.js";
3
+
4
+ //#region src/rules/testing-library.ts
5
+ const testingLibraryRules = async () => {
6
+ const [jestDom, testingLibrary] = await Promise.all([import("eslint-plugin-jest-dom"), interopDefault(import("eslint-plugin-testing-library"))]);
7
+ return {
8
+ ...testingLibrary.configs["flat/react"].rules,
9
+ ...jestDom.configs["flat/recommended"].rules,
10
+ "testing-library/no-test-id-queries": "error"
11
+ };
12
+ };
13
+
14
+ //#endregion
15
+ //#region src/configs/testing-library.ts
16
+ async function testingLibraryConfig() {
17
+ const [jestDom, testingLibrary] = await Promise.all([import("eslint-plugin-jest-dom"), interopDefault(import("eslint-plugin-testing-library"))]);
18
+ return [{
19
+ files: GLOB_TESTS,
20
+ ignores: GLOB_E2E,
21
+ name: "jimmy.codes/testing-library",
22
+ plugins: {
23
+ "jest-dom": jestDom,
24
+ "testing-library": testingLibrary
25
+ },
26
+ rules: await testingLibraryRules()
27
+ }];
28
+ }
29
+
30
+ //#endregion
31
+ export { testingLibraryConfig as default };
@@ -0,0 +1,62 @@
1
+ import { GLOB_JS, GLOB_JSX, GLOB_TESTS } from "./constants-dep165g5.js";
2
+
3
+ //#region src/rules/typescript.ts
4
+ const typescriptRules = {
5
+ "@typescript-eslint/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: false }],
6
+ "@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "separate-type-imports" }],
7
+ "@typescript-eslint/no-deprecated": "warn",
8
+ "@typescript-eslint/no-misused-promises": ["error", { checksVoidReturn: { attributes: false } }],
9
+ "@typescript-eslint/no-unnecessary-type-conversion": "error",
10
+ "@typescript-eslint/no-unused-vars": ["error", {
11
+ args: "all",
12
+ argsIgnorePattern: "^_",
13
+ caughtErrors: "all",
14
+ caughtErrorsIgnorePattern: "^_",
15
+ destructuredArrayIgnorePattern: "^_",
16
+ ignoreRestSiblings: true,
17
+ varsIgnorePattern: "^_"
18
+ }],
19
+ "@typescript-eslint/no-use-before-define": ["error", {
20
+ allowNamedExports: false,
21
+ classes: false,
22
+ functions: false,
23
+ variables: true
24
+ }],
25
+ "@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }],
26
+ "no-use-before-define": "off"
27
+ };
28
+
29
+ //#endregion
30
+ //#region src/configs/typescript.ts
31
+ async function typescriptConfig() {
32
+ const { configs } = await import("typescript-eslint");
33
+ return [
34
+ ...configs.strictTypeChecked,
35
+ ...configs.stylisticTypeChecked.filter((config) => {
36
+ return config.name === "typescript-eslint/stylistic-type-checked";
37
+ }),
38
+ {
39
+ languageOptions: { parserOptions: {
40
+ projectService: true,
41
+ tsconfigRootDir: process.cwd()
42
+ } },
43
+ name: "jimmy.codes/typescript",
44
+ rules: typescriptRules
45
+ },
46
+ {
47
+ files: [GLOB_JS, GLOB_JSX],
48
+ ...configs.disableTypeChecked
49
+ },
50
+ {
51
+ files: GLOB_TESTS,
52
+ name: "jimmy.codes/typescript/testing",
53
+ rules: {
54
+ "@typescript-eslint/no-unsafe-argument": "off",
55
+ "@typescript-eslint/no-unsafe-assignment": "off"
56
+ }
57
+ }
58
+ ];
59
+ }
60
+
61
+ //#endregion
62
+ export { typescriptConfig as default };
@@ -0,0 +1,16 @@
1
+ //#region src/utils/upwarn.ts
2
+ /**
3
+ * Converts all ESLint rules set to `"warn"` into `"error"`.
4
+ *
5
+ * @param rules - A partial set of ESLint rules.
6
+ *
7
+ * @returns A new rules object with all `"warn"` values changed to `"error"`.
8
+ */
9
+ const upwarn = (rules = {}) => {
10
+ return Object.fromEntries(Object.entries(rules).map(([rule, option]) => {
11
+ return [rule, option === "warn" ? "error" : option];
12
+ }));
13
+ };
14
+
15
+ //#endregion
16
+ export { upwarn };
@@ -0,0 +1,74 @@
1
+ import { GLOB_E2E, GLOB_TESTS } from "./constants-dep165g5.js";
2
+ import { interopDefault } from "./interop-default-D4l3hsYQ.js";
3
+
4
+ //#region src/rules/vitest.ts
5
+ const vitestRules = async () => {
6
+ const vitestPlugin = await interopDefault(import("@vitest/eslint-plugin"));
7
+ return {
8
+ ...vitestPlugin.configs.recommended.rules,
9
+ "vitest/consistent-test-it": ["error", {
10
+ fn: "test",
11
+ withinDescribe: "it"
12
+ }],
13
+ "vitest/consistent-vitest-vi": "error",
14
+ "vitest/no-alias-methods": "error",
15
+ "vitest/no-commented-out-tests": "error",
16
+ "vitest/no-conditional-in-test": "error",
17
+ "vitest/no-disabled-tests": "warn",
18
+ "vitest/no-duplicate-hooks": "error",
19
+ "vitest/no-focused-tests": "error",
20
+ "vitest/no-hooks": "off",
21
+ "vitest/no-identical-title": "error",
22
+ "vitest/no-interpolation-in-snapshots": "error",
23
+ "vitest/no-large-snapshots": "off",
24
+ "vitest/no-mocks-import": "error",
25
+ "vitest/no-restricted-matchers": "off",
26
+ "vitest/no-restricted-vi-methods": "off",
27
+ "vitest/no-standalone-expect": "error",
28
+ "vitest/no-test-prefixes": "error",
29
+ "vitest/no-test-return-statement": "error",
30
+ "vitest/prefer-called-once": "error",
31
+ "vitest/prefer-called-times": "off",
32
+ "vitest/prefer-called-with": "error",
33
+ "vitest/prefer-comparison-matcher": "error",
34
+ "vitest/prefer-each": "error",
35
+ "vitest/prefer-equality-matcher": "error",
36
+ "vitest/prefer-expect-assertions": "off",
37
+ "vitest/prefer-expect-resolves": "error",
38
+ "vitest/prefer-hooks-in-order": "error",
39
+ "vitest/prefer-hooks-on-top": "error",
40
+ "vitest/prefer-lowercase-title": "off",
41
+ "vitest/prefer-mock-promise-shorthand": "error",
42
+ "vitest/prefer-snapshot-hint": "error",
43
+ "vitest/prefer-spy-on": "off",
44
+ "vitest/prefer-strict-boolean-matchers": "error",
45
+ "vitest/prefer-strict-equal": "error",
46
+ "vitest/prefer-to-be": "error",
47
+ "vitest/prefer-to-contain": "error",
48
+ "vitest/prefer-to-have-length": "error",
49
+ "vitest/prefer-todo": "warn",
50
+ "vitest/require-hook": "error",
51
+ "vitest/require-to-throw-message": "error",
52
+ "vitest/require-top-level-describe": "off",
53
+ "vitest/valid-expect": "error",
54
+ "vitest/valid-expect-in-promise": "error",
55
+ "vitest/valid-title": ["error", { mustMatch: { it: "^should" } }],
56
+ "vitest/warn-todo": "warn"
57
+ };
58
+ };
59
+
60
+ //#endregion
61
+ //#region src/configs/vitest.ts
62
+ async function vitestConfig() {
63
+ const vitestPlugin = await interopDefault(import("@vitest/eslint-plugin"));
64
+ return [{
65
+ files: GLOB_TESTS,
66
+ ignores: GLOB_E2E,
67
+ ...vitestPlugin.configs.recommended,
68
+ name: "jimmy.codes/vitest",
69
+ rules: await vitestRules()
70
+ }];
71
+ }
72
+
73
+ //#endregion
74
+ export { vitestConfig as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimmy.codes/eslint-config",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "A simple, modern ESLint config that covers most use cases.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -34,9 +34,9 @@
34
34
  "dependencies": {
35
35
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
36
36
  "@eslint-react/eslint-plugin": "^1.52.3",
37
- "@eslint/js": "^9.31.0",
38
- "@next/eslint-plugin-next": "^15.4.2",
39
- "@stylistic/eslint-plugin": "^5.2.1",
37
+ "@eslint/js": "^9.32.0",
38
+ "@next/eslint-plugin-next": "^15.4.4",
39
+ "@stylistic/eslint-plugin": "^5.2.2",
40
40
  "@tanstack/eslint-plugin-query": "^5.81.2",
41
41
  "@types/eslint": "9.6.1",
42
42
  "@typescript-eslint/parser": "^8.38.0",
@@ -49,17 +49,17 @@
49
49
  "eslint-plugin-import-x": "^4.16.1",
50
50
  "eslint-plugin-jest": "^29.0.1",
51
51
  "eslint-plugin-jest-dom": "^5.5.0",
52
- "eslint-plugin-jsdoc": "^51.4.1",
52
+ "eslint-plugin-jsdoc": "^52.0.0",
53
53
  "eslint-plugin-jsx-a11y": "^6.10.2",
54
- "eslint-plugin-n": "^17.21.0",
54
+ "eslint-plugin-n": "^17.21.3",
55
55
  "eslint-plugin-perfectionist": "^4.15.0",
56
- "eslint-plugin-playwright": "^2.2.0",
56
+ "eslint-plugin-playwright": "^2.2.1",
57
57
  "eslint-plugin-react-compiler": "19.1.0-rc.2",
58
58
  "eslint-plugin-react-hooks": "^5.2.0",
59
59
  "eslint-plugin-react-refresh": "0.4.20",
60
60
  "eslint-plugin-regexp": "^2.9.0",
61
61
  "eslint-plugin-storybook": "0.12.0",
62
- "eslint-plugin-testing-library": "^7.6.0",
62
+ "eslint-plugin-testing-library": "^7.6.3",
63
63
  "eslint-plugin-unicorn": "^60.0.0",
64
64
  "globals": "^16.3.0",
65
65
  "local-pkg": "^1.1.1",
@@ -1,71 +0,0 @@
1
- import {
2
- interopDefault
3
- } from "./chunk-72FT76PY.js";
4
- import {
5
- GLOB_ASTRO
6
- } from "./chunk-XMM6FHXC.js";
7
-
8
- // src/configs/astro.ts
9
- import globals from "globals";
10
- async function astroConfig() {
11
- const files = [GLOB_ASTRO];
12
- const { configs, parser: parserTs } = await import("typescript-eslint");
13
- const [astroPlugin, astroParser, jsxA11yPlugin] = await Promise.all([
14
- import("eslint-plugin-astro"),
15
- import("astro-eslint-parser"),
16
- interopDefault(import("eslint-plugin-jsx-a11y"))
17
- ]);
18
- return [
19
- {
20
- files,
21
- languageOptions: {
22
- globals: {
23
- ...globals.node,
24
- Astro: false,
25
- Fragment: false
26
- },
27
- parser: astroParser,
28
- parserOptions: {
29
- extraFileExtensions: [".astro"],
30
- parser: parserTs
31
- },
32
- sourceType: "module"
33
- },
34
- name: "jimmy.codes/astro",
35
- plugins: {
36
- "astro": astroPlugin,
37
- "jsx-a11y": jsxA11yPlugin
38
- },
39
- processor: "astro/client-side-ts",
40
- rules: {
41
- ...jsxA11yPlugin.configs.recommended.rules,
42
- "astro/missing-client-only-directive-value": "error",
43
- "astro/no-conflict-set-directives": "error",
44
- "astro/no-deprecated-astro-canonicalurl": "error",
45
- "astro/no-deprecated-astro-fetchcontent": "error",
46
- "astro/no-deprecated-astro-resolve": "error",
47
- "astro/no-deprecated-getentrybyslug": "error",
48
- "astro/no-exports-from-components": "off",
49
- "astro/no-unused-define-vars-in-style": "error",
50
- "astro/valid-compile": "error"
51
- }
52
- },
53
- {
54
- files,
55
- languageOptions: {
56
- parserOptions: configs.disableTypeChecked.languageOptions?.parserOptions
57
- },
58
- name: "jimmy.codes/astro/disable-type-checked",
59
- rules: configs.disableTypeChecked.rules
60
- },
61
- {
62
- name: "jimmy.codes/astro/imports",
63
- settings: {
64
- "import-x/core-modules": ["astro:content"]
65
- }
66
- }
67
- ];
68
- }
69
- export {
70
- astroConfig as default
71
- };
@@ -1,9 +0,0 @@
1
- // src/utils/interop-default.ts
2
- var interopDefault = async (module) => {
3
- const resolved = await module;
4
- return resolved?.default ?? resolved;
5
- };
6
-
7
- export {
8
- interopDefault
9
- };
@@ -1,55 +0,0 @@
1
- import {
2
- TESTING_LIBRARY_FAMILY
3
- } from "./chunk-XMM6FHXC.js";
4
-
5
- // src/utils/has-dependency.ts
6
- import { isPackageExists } from "local-pkg";
7
- var hasTypescript = () => {
8
- return isPackageExists("typescript");
9
- };
10
- var hasReact = () => {
11
- return isPackageExists("react");
12
- };
13
- var hasVitest = () => {
14
- return isPackageExists("vitest");
15
- };
16
- var hasJest = () => {
17
- return isPackageExists("jest");
18
- };
19
- var hasTestingLibrary = () => {
20
- return TESTING_LIBRARY_FAMILY.some((pkg) => {
21
- return isPackageExists(pkg);
22
- });
23
- };
24
- var hasReactQuery = () => {
25
- return isPackageExists("@tanstack/react-query");
26
- };
27
- var hasAstro = () => {
28
- return isPackageExists("astro");
29
- };
30
- var hasPlaywright = () => {
31
- return isPackageExists("@playwright/test");
32
- };
33
- var hasStorybook = () => {
34
- return isPackageExists("storybook");
35
- };
36
- var hasNext = () => {
37
- return isPackageExists("next");
38
- };
39
- var hasVite = () => {
40
- return isPackageExists("vite");
41
- };
42
-
43
- export {
44
- hasTypescript,
45
- hasReact,
46
- hasVitest,
47
- hasJest,
48
- hasTestingLibrary,
49
- hasReactQuery,
50
- hasAstro,
51
- hasPlaywright,
52
- hasStorybook,
53
- hasNext,
54
- hasVite
55
- };