@jimmy.codes/eslint-config 5.20.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.
- package/dist/astro-CqgWkoKy.js +63 -0
- package/dist/constants-dep165g5.js +73 -0
- package/dist/has-dependency-B3Fi8OzA.js +42 -0
- package/dist/index.d.ts +7449 -10031
- package/dist/index.js +448 -559
- package/dist/interop-default-D4l3hsYQ.js +17 -0
- package/dist/jest-CzZHXxA7.js +62 -0
- package/dist/nextjs-Bh8fqE_o.js +24 -0
- package/dist/playwright-CHYoYi52.js +41 -0
- package/dist/react-BE1N8MTt.js +92 -0
- package/dist/storybook-BO4plVPp.js +32 -0
- package/dist/tanstack-query-DF8OWtLq.js +24 -0
- package/dist/testing-library-XmNQWB2F.js +31 -0
- package/dist/typescript-fvBsWGqo.js +62 -0
- package/dist/upwarn-C7t3ub-R.js +16 -0
- package/dist/vitest-J--7DiIk.js +74 -0
- package/package.json +14 -14
- package/dist/astro-NEJ73UBN.js +0 -71
- package/dist/chunk-72FT76PY.js +0 -9
- package/dist/chunk-7RIW3P47.js +0 -55
- package/dist/chunk-BDIXPIKB.js +0 -12
- package/dist/chunk-XMM6FHXC.js +0 -82
- package/dist/jest-SCRGNX6Z.js +0 -80
- package/dist/nextjs-CRRBTFXP.js +0 -36
- package/dist/playwright-2HMMFF3D.js +0 -50
- package/dist/react-IAR3MTFF.js +0 -126
- package/dist/storybook-XHFO7L4T.js +0 -38
- package/dist/tanstack-query-MM3M2QJO.js +0 -35
- package/dist/testing-library-QHZMYCZH.js +0 -43
- package/dist/typescript-PLNEW3M4.js +0 -86
- package/dist/vitest-IAENZQ7B.js +0 -92
package/dist/chunk-7RIW3P47.js
DELETED
|
@@ -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
|
-
};
|
package/dist/chunk-BDIXPIKB.js
DELETED
package/dist/chunk-XMM6FHXC.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
// src/constants.ts
|
|
2
|
-
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
3
|
-
var GLOB_IGNORES = [
|
|
4
|
-
"**/node_modules",
|
|
5
|
-
"**/dist",
|
|
6
|
-
"**/package-lock.json",
|
|
7
|
-
"**/yarn.lock",
|
|
8
|
-
"**/pnpm-lock.yaml",
|
|
9
|
-
"**/bun.lockb",
|
|
10
|
-
"**/output",
|
|
11
|
-
"**/coverage",
|
|
12
|
-
"**/temp",
|
|
13
|
-
"**/.temp",
|
|
14
|
-
"**/tmp",
|
|
15
|
-
"**/.tmp",
|
|
16
|
-
"**/.history",
|
|
17
|
-
"**/.vitepress/cache",
|
|
18
|
-
"**/.nuxt",
|
|
19
|
-
"**/.next",
|
|
20
|
-
"**/.vercel",
|
|
21
|
-
"**/.changeset",
|
|
22
|
-
"**/.idea",
|
|
23
|
-
"**/.cache",
|
|
24
|
-
"**/.output",
|
|
25
|
-
"**/.vite-inspect",
|
|
26
|
-
"**/.yarn",
|
|
27
|
-
"**/storybook-static",
|
|
28
|
-
"**/.eslint-config-inspector",
|
|
29
|
-
"**/playwright-report",
|
|
30
|
-
"**/.astro",
|
|
31
|
-
"**/.vinxi",
|
|
32
|
-
"**/app.config.timestamp_*.js",
|
|
33
|
-
"**/.tanstack",
|
|
34
|
-
"**/.nitro",
|
|
35
|
-
"**/CHANGELOG*.md",
|
|
36
|
-
"**/*.min.*",
|
|
37
|
-
"**/LICENSE*",
|
|
38
|
-
"**/__snapshots__",
|
|
39
|
-
"**/auto-import?(s).d.ts",
|
|
40
|
-
"**/components.d.ts",
|
|
41
|
-
"**/vite.config.ts.*.mjs",
|
|
42
|
-
"**/*.gen.*",
|
|
43
|
-
"!.storybook"
|
|
44
|
-
];
|
|
45
|
-
var GLOB_JS = "**/*.?([cm])js";
|
|
46
|
-
var GLOB_JSX = "**/*.?([cm])jsx";
|
|
47
|
-
var GLOB_TS = "**/*.?([cm])ts";
|
|
48
|
-
var GLOB_TSX = "**/*.?([cm])tsx";
|
|
49
|
-
var GLOB_TESTS = [
|
|
50
|
-
`**/__tests__/**/*.${GLOB_SRC_EXT}`,
|
|
51
|
-
`**/*.spec.${GLOB_SRC_EXT}`,
|
|
52
|
-
`**/*.test.${GLOB_SRC_EXT}`,
|
|
53
|
-
`**/*.bench.${GLOB_SRC_EXT}`,
|
|
54
|
-
`**/*.benchmark.${GLOB_SRC_EXT}`
|
|
55
|
-
];
|
|
56
|
-
var GLOB_PLAYWRIGHT = [
|
|
57
|
-
`**/e2e/**/*.spec.${GLOB_SRC_EXT}`,
|
|
58
|
-
`**/e2e/**/*.test.${GLOB_SRC_EXT}`
|
|
59
|
-
];
|
|
60
|
-
var GLOB_E2E = [
|
|
61
|
-
...GLOB_PLAYWRIGHT,
|
|
62
|
-
`**/cypress/**/*.spec.${GLOB_SRC_EXT}`,
|
|
63
|
-
`**/cypress/**/*.test.${GLOB_SRC_EXT}`
|
|
64
|
-
];
|
|
65
|
-
var GLOB_NEXTJS = [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX];
|
|
66
|
-
var GLOB_CJS = "**/*.cjs";
|
|
67
|
-
var GLOB_ASTRO = "**/*.astro";
|
|
68
|
-
var TESTING_LIBRARY_FAMILY = ["@testing-library/react"];
|
|
69
|
-
|
|
70
|
-
export {
|
|
71
|
-
GLOB_IGNORES,
|
|
72
|
-
GLOB_JS,
|
|
73
|
-
GLOB_JSX,
|
|
74
|
-
GLOB_TSX,
|
|
75
|
-
GLOB_TESTS,
|
|
76
|
-
GLOB_PLAYWRIGHT,
|
|
77
|
-
GLOB_E2E,
|
|
78
|
-
GLOB_NEXTJS,
|
|
79
|
-
GLOB_CJS,
|
|
80
|
-
GLOB_ASTRO,
|
|
81
|
-
TESTING_LIBRARY_FAMILY
|
|
82
|
-
};
|
package/dist/jest-SCRGNX6Z.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interopDefault
|
|
3
|
-
} from "./chunk-72FT76PY.js";
|
|
4
|
-
import {
|
|
5
|
-
GLOB_E2E,
|
|
6
|
-
GLOB_TESTS
|
|
7
|
-
} from "./chunk-XMM6FHXC.js";
|
|
8
|
-
|
|
9
|
-
// src/rules/jest.ts
|
|
10
|
-
var jestRules = async () => {
|
|
11
|
-
const jestPlugin = await interopDefault(import("eslint-plugin-jest"));
|
|
12
|
-
return {
|
|
13
|
-
...jestPlugin.configs["flat/recommended"].rules,
|
|
14
|
-
...jestPlugin.configs["flat/style"].rules,
|
|
15
|
-
"jest/consistent-test-it": [
|
|
16
|
-
"error",
|
|
17
|
-
{
|
|
18
|
-
fn: "test",
|
|
19
|
-
withinDescribe: "it"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"jest/expect-expect": "error",
|
|
23
|
-
"jest/no-alias-methods": "error",
|
|
24
|
-
"jest/no-commented-out-tests": "error",
|
|
25
|
-
"jest/no-conditional-in-test": "error",
|
|
26
|
-
"jest/no-confusing-set-timeout": "error",
|
|
27
|
-
"jest/no-duplicate-hooks": "error",
|
|
28
|
-
"jest/no-hooks": "off",
|
|
29
|
-
"jest/no-large-snapshots": "off",
|
|
30
|
-
"jest/no-restricted-jest-methods": "off",
|
|
31
|
-
"jest/no-restricted-matchers": "off",
|
|
32
|
-
"jest/no-test-return-statement": "error",
|
|
33
|
-
"jest/no-untyped-mock-factory": "off",
|
|
34
|
-
// requires typescript
|
|
35
|
-
"jest/prefer-called-with": "error",
|
|
36
|
-
"jest/prefer-comparison-matcher": "error",
|
|
37
|
-
"jest/prefer-each": "error",
|
|
38
|
-
"jest/prefer-equality-matcher": "error",
|
|
39
|
-
"jest/prefer-expect-assertions": "off",
|
|
40
|
-
"jest/prefer-expect-resolves": "error",
|
|
41
|
-
"jest/prefer-hooks-in-order": "error",
|
|
42
|
-
"jest/prefer-hooks-on-top": "error",
|
|
43
|
-
"jest/prefer-lowercase-title": "off",
|
|
44
|
-
"jest/prefer-mock-promise-shorthand": "error",
|
|
45
|
-
"jest/prefer-snapshot-hint": "error",
|
|
46
|
-
"jest/prefer-spy-on": "off",
|
|
47
|
-
"jest/prefer-strict-equal": "error",
|
|
48
|
-
"jest/prefer-todo": "warn",
|
|
49
|
-
"jest/require-hook": "error",
|
|
50
|
-
"jest/require-to-throw-message": "error",
|
|
51
|
-
"jest/require-top-level-describe": "off",
|
|
52
|
-
"jest/unbound-method": "off",
|
|
53
|
-
// requires typescript
|
|
54
|
-
"jest/valid-title": [
|
|
55
|
-
"error",
|
|
56
|
-
{
|
|
57
|
-
mustMatch: {
|
|
58
|
-
it: "^should"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// src/configs/jest.ts
|
|
66
|
-
async function jestConfig() {
|
|
67
|
-
const jestPlugin = await interopDefault(import("eslint-plugin-jest"));
|
|
68
|
-
return [
|
|
69
|
-
{
|
|
70
|
-
files: GLOB_TESTS,
|
|
71
|
-
ignores: GLOB_E2E,
|
|
72
|
-
...jestPlugin.configs["flat/recommended"],
|
|
73
|
-
name: "jimmy.codes/jest",
|
|
74
|
-
rules: await jestRules()
|
|
75
|
-
}
|
|
76
|
-
];
|
|
77
|
-
}
|
|
78
|
-
export {
|
|
79
|
-
jestConfig as default
|
|
80
|
-
};
|
package/dist/nextjs-CRRBTFXP.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
upwarn
|
|
3
|
-
} from "./chunk-BDIXPIKB.js";
|
|
4
|
-
import {
|
|
5
|
-
interopDefault
|
|
6
|
-
} from "./chunk-72FT76PY.js";
|
|
7
|
-
import {
|
|
8
|
-
GLOB_NEXTJS
|
|
9
|
-
} from "./chunk-XMM6FHXC.js";
|
|
10
|
-
|
|
11
|
-
// src/rules/nextjs.ts
|
|
12
|
-
var nextjsRules = async () => {
|
|
13
|
-
const nextjsPlugin = await interopDefault(import("@next/eslint-plugin-next"));
|
|
14
|
-
return upwarn(
|
|
15
|
-
// @next/eslint-plugin-next types for each rule use string instead of Linter.RuleLevel,
|
|
16
|
-
nextjsPlugin.configs.recommended.rules
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// src/configs/nextjs.ts
|
|
21
|
-
async function nextjsConfig() {
|
|
22
|
-
const nextjsPlugin = await interopDefault(import("@next/eslint-plugin-next"));
|
|
23
|
-
return [
|
|
24
|
-
{
|
|
25
|
-
files: GLOB_NEXTJS,
|
|
26
|
-
name: "jimmy.codes/nextjs",
|
|
27
|
-
plugins: {
|
|
28
|
-
"@next/next": nextjsPlugin
|
|
29
|
-
},
|
|
30
|
-
rules: await nextjsRules()
|
|
31
|
-
}
|
|
32
|
-
];
|
|
33
|
-
}
|
|
34
|
-
export {
|
|
35
|
-
nextjsConfig as default
|
|
36
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interopDefault
|
|
3
|
-
} from "./chunk-72FT76PY.js";
|
|
4
|
-
import {
|
|
5
|
-
GLOB_PLAYWRIGHT
|
|
6
|
-
} from "./chunk-XMM6FHXC.js";
|
|
7
|
-
|
|
8
|
-
// src/rules/playwright.ts
|
|
9
|
-
var playwrightRules = async () => {
|
|
10
|
-
const playwrightPlugin = await interopDefault(
|
|
11
|
-
import("eslint-plugin-playwright")
|
|
12
|
-
);
|
|
13
|
-
return {
|
|
14
|
-
...playwrightPlugin.configs["flat/recommended"].rules,
|
|
15
|
-
"playwright/expect-expect": "error",
|
|
16
|
-
"playwright/max-nested-describe": "error",
|
|
17
|
-
"playwright/no-conditional-expect": "error",
|
|
18
|
-
"playwright/no-conditional-in-test": "error",
|
|
19
|
-
"playwright/no-element-handle": "error",
|
|
20
|
-
"playwright/no-eval": "error",
|
|
21
|
-
"playwright/no-force-option": "error",
|
|
22
|
-
"playwright/no-nested-step": "error",
|
|
23
|
-
"playwright/no-page-pause": "error",
|
|
24
|
-
"playwright/no-skipped-test": "error",
|
|
25
|
-
"playwright/no-slowed-test": "error",
|
|
26
|
-
"playwright/no-useless-await": "error",
|
|
27
|
-
"playwright/no-useless-not": "error",
|
|
28
|
-
"playwright/no-wait-for-selector": "error",
|
|
29
|
-
"playwright/no-wait-for-timeout": "error",
|
|
30
|
-
"playwright/valid-title": "off"
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// src/configs/playwright.ts
|
|
35
|
-
async function playwrightConfig() {
|
|
36
|
-
const playwrightPlugin = await interopDefault(
|
|
37
|
-
import("eslint-plugin-playwright")
|
|
38
|
-
);
|
|
39
|
-
return [
|
|
40
|
-
{
|
|
41
|
-
...playwrightPlugin.configs["flat/recommended"],
|
|
42
|
-
files: GLOB_PLAYWRIGHT,
|
|
43
|
-
name: "jimmy.codes/playwright",
|
|
44
|
-
rules: await playwrightRules()
|
|
45
|
-
}
|
|
46
|
-
];
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
playwrightConfig as default
|
|
50
|
-
};
|
package/dist/react-IAR3MTFF.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
upwarn
|
|
3
|
-
} from "./chunk-BDIXPIKB.js";
|
|
4
|
-
import {
|
|
5
|
-
hasNext,
|
|
6
|
-
hasTypescript,
|
|
7
|
-
hasVite
|
|
8
|
-
} from "./chunk-7RIW3P47.js";
|
|
9
|
-
import {
|
|
10
|
-
interopDefault
|
|
11
|
-
} from "./chunk-72FT76PY.js";
|
|
12
|
-
import {
|
|
13
|
-
GLOB_JSX,
|
|
14
|
-
GLOB_TSX
|
|
15
|
-
} from "./chunk-XMM6FHXC.js";
|
|
16
|
-
|
|
17
|
-
// src/configs/react.ts
|
|
18
|
-
import globals from "globals";
|
|
19
|
-
|
|
20
|
-
// src/rules/react.ts
|
|
21
|
-
var nextAllowedExportNames = [
|
|
22
|
-
"dynamic",
|
|
23
|
-
"dynamicParams",
|
|
24
|
-
"revalidate",
|
|
25
|
-
"fetchCache",
|
|
26
|
-
"runtime",
|
|
27
|
-
"preferredRegion",
|
|
28
|
-
"maxDuration",
|
|
29
|
-
"config",
|
|
30
|
-
"generateStaticParams",
|
|
31
|
-
"metadata",
|
|
32
|
-
"generateMetadata",
|
|
33
|
-
"viewport",
|
|
34
|
-
"generateViewport"
|
|
35
|
-
];
|
|
36
|
-
var reactRules = async () => {
|
|
37
|
-
const [{ configs: reactConfigs }, jsxA11yPlugin] = await Promise.all([
|
|
38
|
-
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
39
|
-
interopDefault(import("eslint-plugin-jsx-a11y"))
|
|
40
|
-
]);
|
|
41
|
-
const isUsingNextjs = hasNext();
|
|
42
|
-
const isUsingVite = hasVite();
|
|
43
|
-
const isUsingTypesScript = hasTypescript();
|
|
44
|
-
const reactPluginRules = isUsingTypesScript ? reactConfigs["recommended-type-checked"].rules : reactConfigs.recommended.rules;
|
|
45
|
-
return {
|
|
46
|
-
...jsxA11yPlugin.configs.recommended.rules,
|
|
47
|
-
...upwarn(reactPluginRules),
|
|
48
|
-
"@eslint-react/avoid-shorthand-boolean": "off",
|
|
49
|
-
"@eslint-react/avoid-shorthand-fragment": "off",
|
|
50
|
-
"@eslint-react/hooks-extra/no-unnecessary-use-callback": "error",
|
|
51
|
-
"@eslint-react/hooks-extra/no-unnecessary-use-memo": "error",
|
|
52
|
-
"@eslint-react/hooks-extra/no-unnecessary-use-prefix": "error",
|
|
53
|
-
"@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "error",
|
|
54
|
-
"@eslint-react/no-children-prop": "error",
|
|
55
|
-
"@eslint-react/no-complex-conditional-rendering": "error",
|
|
56
|
-
"@eslint-react/no-useless-fragment": "error",
|
|
57
|
-
"@eslint-react/prefer-react-namespace-import": "error",
|
|
58
|
-
"@eslint-react/prefer-shorthand-boolean": "error",
|
|
59
|
-
"@eslint-react/prefer-shorthand-fragment": "error",
|
|
60
|
-
"react-compiler/react-compiler": "error",
|
|
61
|
-
"react-hooks/exhaustive-deps": "error",
|
|
62
|
-
"react-hooks/rules-of-hooks": "error",
|
|
63
|
-
"react-refresh/only-export-components": [
|
|
64
|
-
"warn",
|
|
65
|
-
{
|
|
66
|
-
allowConstantExport: isUsingVite,
|
|
67
|
-
allowExportNames: isUsingNextjs ? nextAllowedExportNames : []
|
|
68
|
-
}
|
|
69
|
-
]
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
// src/configs/react.ts
|
|
74
|
-
async function reactConfig() {
|
|
75
|
-
const [
|
|
76
|
-
reactPlugin,
|
|
77
|
-
jsxA11yPlugin,
|
|
78
|
-
reactHooksPlugin,
|
|
79
|
-
reactRefreshPlugin,
|
|
80
|
-
reactCompilerPlugin
|
|
81
|
-
] = await Promise.all([
|
|
82
|
-
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
83
|
-
interopDefault(import("eslint-plugin-jsx-a11y")),
|
|
84
|
-
import("eslint-plugin-react-hooks"),
|
|
85
|
-
interopDefault(import("eslint-plugin-react-refresh")),
|
|
86
|
-
import("eslint-plugin-react-compiler")
|
|
87
|
-
]);
|
|
88
|
-
const reactPlugins = reactPlugin.configs.all.plugins;
|
|
89
|
-
return [
|
|
90
|
-
{
|
|
91
|
-
files: [GLOB_JSX, GLOB_TSX],
|
|
92
|
-
languageOptions: {
|
|
93
|
-
globals: {
|
|
94
|
-
...globals.browser
|
|
95
|
-
},
|
|
96
|
-
parserOptions: {
|
|
97
|
-
ecmaFeatures: {
|
|
98
|
-
jsx: true
|
|
99
|
-
},
|
|
100
|
-
jsxPragma: null
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
name: "jimmy.codes/react",
|
|
104
|
-
plugins: {
|
|
105
|
-
"@eslint-react": reactPlugins["@eslint-react"],
|
|
106
|
-
"@eslint-react/dom": reactPlugins["@eslint-react/dom"],
|
|
107
|
-
"@eslint-react/hooks-extra": reactPlugins["@eslint-react/hooks-extra"],
|
|
108
|
-
"@eslint-react/naming-convention": reactPlugins["@eslint-react/naming-convention"],
|
|
109
|
-
"@eslint-react/web-api": reactPlugins["@eslint-react/web-api"],
|
|
110
|
-
"jsx-a11y": jsxA11yPlugin,
|
|
111
|
-
"react-compiler": reactCompilerPlugin,
|
|
112
|
-
"react-hooks": reactHooksPlugin,
|
|
113
|
-
"react-refresh": reactRefreshPlugin
|
|
114
|
-
},
|
|
115
|
-
rules: await reactRules(),
|
|
116
|
-
settings: {
|
|
117
|
-
react: {
|
|
118
|
-
version: "detect"
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
];
|
|
123
|
-
}
|
|
124
|
-
export {
|
|
125
|
-
reactConfig as default
|
|
126
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
upwarn
|
|
3
|
-
} from "./chunk-BDIXPIKB.js";
|
|
4
|
-
import {
|
|
5
|
-
interopDefault
|
|
6
|
-
} from "./chunk-72FT76PY.js";
|
|
7
|
-
|
|
8
|
-
// src/configs/storybook.ts
|
|
9
|
-
async function storybookConfig() {
|
|
10
|
-
const { configs } = await interopDefault(import("eslint-plugin-storybook"));
|
|
11
|
-
const [setup, storiesConfig, mainConfig] = configs["flat/recommended"];
|
|
12
|
-
return [
|
|
13
|
-
{
|
|
14
|
-
name: "jimmy.codes/storybook/setup",
|
|
15
|
-
plugins: setup?.plugins
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
files: storiesConfig?.files,
|
|
19
|
-
name: "jimmy.codes/storybook/stories-rules",
|
|
20
|
-
rules: {
|
|
21
|
-
...upwarn(storiesConfig?.rules),
|
|
22
|
-
"import-x/no-anonymous-default-export": "off",
|
|
23
|
-
"storybook/meta-satisfies-type": "error",
|
|
24
|
-
"unicorn/no-anonymous-default-export": "off"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
files: mainConfig?.files,
|
|
29
|
-
name: "jimmy.codes/storybook/main-rules",
|
|
30
|
-
rules: {
|
|
31
|
-
...mainConfig?.rules
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
];
|
|
35
|
-
}
|
|
36
|
-
export {
|
|
37
|
-
storybookConfig as default
|
|
38
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interopDefault
|
|
3
|
-
} from "./chunk-72FT76PY.js";
|
|
4
|
-
import {
|
|
5
|
-
GLOB_JSX,
|
|
6
|
-
GLOB_TSX
|
|
7
|
-
} from "./chunk-XMM6FHXC.js";
|
|
8
|
-
|
|
9
|
-
// src/configs/tanstack-query.ts
|
|
10
|
-
async function tanstackQueryConfig() {
|
|
11
|
-
const queryPlugin = await interopDefault(
|
|
12
|
-
import("@tanstack/eslint-plugin-query")
|
|
13
|
-
);
|
|
14
|
-
return [
|
|
15
|
-
{
|
|
16
|
-
files: [GLOB_JSX, GLOB_TSX],
|
|
17
|
-
name: "jimmy.codes/tanstack/react-query",
|
|
18
|
-
plugins: {
|
|
19
|
-
"@tanstack/query": queryPlugin
|
|
20
|
-
},
|
|
21
|
-
rules: {
|
|
22
|
-
"@tanstack/query/exhaustive-deps": "error",
|
|
23
|
-
"@tanstack/query/infinite-query-property-order": "error",
|
|
24
|
-
"@tanstack/query/mutation-property-order": "error",
|
|
25
|
-
"@tanstack/query/no-rest-destructuring": "error",
|
|
26
|
-
"@tanstack/query/no-unstable-deps": "error",
|
|
27
|
-
"@tanstack/query/no-void-query-fn": "error",
|
|
28
|
-
"@tanstack/query/stable-query-client": "error"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
tanstackQueryConfig as default
|
|
35
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interopDefault
|
|
3
|
-
} from "./chunk-72FT76PY.js";
|
|
4
|
-
import {
|
|
5
|
-
GLOB_E2E,
|
|
6
|
-
GLOB_TESTS
|
|
7
|
-
} from "./chunk-XMM6FHXC.js";
|
|
8
|
-
|
|
9
|
-
// src/rules/testing-library.ts
|
|
10
|
-
var testingLibraryRules = async () => {
|
|
11
|
-
const [jestDom, testingLibrary] = await Promise.all([
|
|
12
|
-
import("eslint-plugin-jest-dom"),
|
|
13
|
-
interopDefault(import("eslint-plugin-testing-library"))
|
|
14
|
-
]);
|
|
15
|
-
return {
|
|
16
|
-
...testingLibrary.configs["flat/react"].rules,
|
|
17
|
-
...jestDom.configs["flat/recommended"].rules,
|
|
18
|
-
"testing-library/no-test-id-queries": "error"
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// src/configs/testing-library.ts
|
|
23
|
-
async function testingLibraryConfig() {
|
|
24
|
-
const [jestDom, testingLibrary] = await Promise.all([
|
|
25
|
-
import("eslint-plugin-jest-dom"),
|
|
26
|
-
interopDefault(import("eslint-plugin-testing-library"))
|
|
27
|
-
]);
|
|
28
|
-
return [
|
|
29
|
-
{
|
|
30
|
-
files: GLOB_TESTS,
|
|
31
|
-
ignores: GLOB_E2E,
|
|
32
|
-
name: "jimmy.codes/testing-library",
|
|
33
|
-
plugins: {
|
|
34
|
-
"jest-dom": jestDom,
|
|
35
|
-
"testing-library": testingLibrary
|
|
36
|
-
},
|
|
37
|
-
rules: await testingLibraryRules()
|
|
38
|
-
}
|
|
39
|
-
];
|
|
40
|
-
}
|
|
41
|
-
export {
|
|
42
|
-
testingLibraryConfig as default
|
|
43
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GLOB_JS,
|
|
3
|
-
GLOB_JSX,
|
|
4
|
-
GLOB_TESTS
|
|
5
|
-
} from "./chunk-XMM6FHXC.js";
|
|
6
|
-
|
|
7
|
-
// src/rules/typescript.ts
|
|
8
|
-
var typescriptRules = {
|
|
9
|
-
"@typescript-eslint/consistent-type-exports": [
|
|
10
|
-
"error",
|
|
11
|
-
{ fixMixedExportsWithInlineTypeSpecifier: false }
|
|
12
|
-
],
|
|
13
|
-
"@typescript-eslint/consistent-type-imports": [
|
|
14
|
-
"error",
|
|
15
|
-
{ fixStyle: "separate-type-imports" }
|
|
16
|
-
],
|
|
17
|
-
"@typescript-eslint/no-deprecated": "warn",
|
|
18
|
-
"@typescript-eslint/no-misused-promises": [
|
|
19
|
-
"error",
|
|
20
|
-
{ checksVoidReturn: { attributes: false } }
|
|
21
|
-
],
|
|
22
|
-
"@typescript-eslint/no-unnecessary-type-conversion": "error",
|
|
23
|
-
"@typescript-eslint/no-unused-vars": [
|
|
24
|
-
"error",
|
|
25
|
-
// https://typescript-eslint.io/rules/no-unused-vars/#benefits-over-typescript
|
|
26
|
-
{
|
|
27
|
-
args: "all",
|
|
28
|
-
argsIgnorePattern: "^_",
|
|
29
|
-
caughtErrors: "all",
|
|
30
|
-
caughtErrorsIgnorePattern: "^_",
|
|
31
|
-
destructuredArrayIgnorePattern: "^_",
|
|
32
|
-
ignoreRestSiblings: true,
|
|
33
|
-
varsIgnorePattern: "^_"
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
"@typescript-eslint/no-use-before-define": [
|
|
37
|
-
"error",
|
|
38
|
-
{
|
|
39
|
-
allowNamedExports: false,
|
|
40
|
-
classes: false,
|
|
41
|
-
functions: false,
|
|
42
|
-
variables: true
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"@typescript-eslint/restrict-template-expressions": [
|
|
46
|
-
"error",
|
|
47
|
-
{ allowNumber: true }
|
|
48
|
-
],
|
|
49
|
-
"no-use-before-define": "off"
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
// src/configs/typescript.ts
|
|
53
|
-
async function typescriptConfig() {
|
|
54
|
-
const { configs } = await import("typescript-eslint");
|
|
55
|
-
return [
|
|
56
|
-
...configs.strictTypeChecked,
|
|
57
|
-
...configs.stylisticTypeChecked.filter((config) => {
|
|
58
|
-
return config.name === "typescript-eslint/stylistic-type-checked";
|
|
59
|
-
}),
|
|
60
|
-
{
|
|
61
|
-
languageOptions: {
|
|
62
|
-
parserOptions: {
|
|
63
|
-
projectService: true,
|
|
64
|
-
tsconfigRootDir: process.cwd()
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
name: "jimmy.codes/typescript",
|
|
68
|
-
rules: typescriptRules
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
files: [GLOB_JS, GLOB_JSX],
|
|
72
|
-
...configs.disableTypeChecked
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
files: GLOB_TESTS,
|
|
76
|
-
name: "jimmy.codes/typescript/testing",
|
|
77
|
-
rules: {
|
|
78
|
-
"@typescript-eslint/no-unsafe-argument": "off",
|
|
79
|
-
"@typescript-eslint/no-unsafe-assignment": "off"
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
];
|
|
83
|
-
}
|
|
84
|
-
export {
|
|
85
|
-
typescriptConfig as default
|
|
86
|
-
};
|