@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.
- 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 +7299 -9884
- package/dist/index.js +448 -558
- 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 +8 -8
- 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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { GLOB_ASTRO } from "./constants-dep165g5.js";
|
|
2
|
+
import { interopDefault } from "./interop-default-D4l3hsYQ.js";
|
|
3
|
+
import globals from "globals";
|
|
4
|
+
|
|
5
|
+
//#region src/configs/astro.ts
|
|
6
|
+
async function astroConfig() {
|
|
7
|
+
const files = [GLOB_ASTRO];
|
|
8
|
+
const { configs, parser: parserTs } = await import("typescript-eslint");
|
|
9
|
+
const [astroPlugin, astroParser, jsxA11yPlugin] = await Promise.all([
|
|
10
|
+
import("eslint-plugin-astro"),
|
|
11
|
+
import("astro-eslint-parser"),
|
|
12
|
+
interopDefault(import("eslint-plugin-jsx-a11y"))
|
|
13
|
+
]);
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
files,
|
|
17
|
+
languageOptions: {
|
|
18
|
+
globals: {
|
|
19
|
+
...globals.node,
|
|
20
|
+
Astro: false,
|
|
21
|
+
Fragment: false
|
|
22
|
+
},
|
|
23
|
+
parser: astroParser,
|
|
24
|
+
parserOptions: {
|
|
25
|
+
extraFileExtensions: [".astro"],
|
|
26
|
+
parser: parserTs
|
|
27
|
+
},
|
|
28
|
+
sourceType: "module"
|
|
29
|
+
},
|
|
30
|
+
name: "jimmy.codes/astro",
|
|
31
|
+
plugins: {
|
|
32
|
+
"astro": astroPlugin,
|
|
33
|
+
"jsx-a11y": jsxA11yPlugin
|
|
34
|
+
},
|
|
35
|
+
processor: "astro/client-side-ts",
|
|
36
|
+
rules: {
|
|
37
|
+
...jsxA11yPlugin.configs.recommended.rules,
|
|
38
|
+
"astro/missing-client-only-directive-value": "error",
|
|
39
|
+
"astro/no-conflict-set-directives": "error",
|
|
40
|
+
"astro/no-deprecated-astro-canonicalurl": "error",
|
|
41
|
+
"astro/no-deprecated-astro-fetchcontent": "error",
|
|
42
|
+
"astro/no-deprecated-astro-resolve": "error",
|
|
43
|
+
"astro/no-deprecated-getentrybyslug": "error",
|
|
44
|
+
"astro/no-exports-from-components": "off",
|
|
45
|
+
"astro/no-unused-define-vars-in-style": "error",
|
|
46
|
+
"astro/valid-compile": "error"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
files,
|
|
51
|
+
languageOptions: { parserOptions: configs.disableTypeChecked.languageOptions?.parserOptions },
|
|
52
|
+
name: "jimmy.codes/astro/disable-type-checked",
|
|
53
|
+
rules: configs.disableTypeChecked.rules
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "jimmy.codes/astro/imports",
|
|
57
|
+
settings: { "import-x/core-modules": ["astro:content"] }
|
|
58
|
+
}
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { astroConfig as default };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//#region src/constants.ts
|
|
2
|
+
const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
3
|
+
const 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
|
+
const GLOB_JS = "**/*.?([cm])js";
|
|
46
|
+
const GLOB_JSX = "**/*.?([cm])jsx";
|
|
47
|
+
const GLOB_TS = "**/*.?([cm])ts";
|
|
48
|
+
const GLOB_TSX = "**/*.?([cm])tsx";
|
|
49
|
+
const 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
|
+
const GLOB_PLAYWRIGHT = [`**/e2e/**/*.spec.${GLOB_SRC_EXT}`, `**/e2e/**/*.test.${GLOB_SRC_EXT}`];
|
|
57
|
+
const GLOB_E2E = [
|
|
58
|
+
...GLOB_PLAYWRIGHT,
|
|
59
|
+
`**/cypress/**/*.spec.${GLOB_SRC_EXT}`,
|
|
60
|
+
`**/cypress/**/*.test.${GLOB_SRC_EXT}`
|
|
61
|
+
];
|
|
62
|
+
const GLOB_NEXTJS = [
|
|
63
|
+
GLOB_JS,
|
|
64
|
+
GLOB_JSX,
|
|
65
|
+
GLOB_TS,
|
|
66
|
+
GLOB_TSX
|
|
67
|
+
];
|
|
68
|
+
const GLOB_CJS = "**/*.cjs";
|
|
69
|
+
const GLOB_ASTRO = "**/*.astro";
|
|
70
|
+
const TESTING_LIBRARY_FAMILY = ["@testing-library/react"];
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
export { GLOB_ASTRO, GLOB_CJS, GLOB_E2E, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_NEXTJS, GLOB_PLAYWRIGHT, GLOB_TESTS, GLOB_TSX, TESTING_LIBRARY_FAMILY };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { TESTING_LIBRARY_FAMILY } from "./constants-dep165g5.js";
|
|
2
|
+
import { isPackageExists } from "local-pkg";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/has-dependency.ts
|
|
5
|
+
const hasTypescript = () => {
|
|
6
|
+
return isPackageExists("typescript");
|
|
7
|
+
};
|
|
8
|
+
const hasReact = () => {
|
|
9
|
+
return isPackageExists("react");
|
|
10
|
+
};
|
|
11
|
+
const hasVitest = () => {
|
|
12
|
+
return isPackageExists("vitest");
|
|
13
|
+
};
|
|
14
|
+
const hasJest = () => {
|
|
15
|
+
return isPackageExists("jest");
|
|
16
|
+
};
|
|
17
|
+
const hasTestingLibrary = () => {
|
|
18
|
+
return TESTING_LIBRARY_FAMILY.some((pkg) => {
|
|
19
|
+
return isPackageExists(pkg);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
const hasReactQuery = () => {
|
|
23
|
+
return isPackageExists("@tanstack/react-query");
|
|
24
|
+
};
|
|
25
|
+
const hasAstro = () => {
|
|
26
|
+
return isPackageExists("astro");
|
|
27
|
+
};
|
|
28
|
+
const hasPlaywright = () => {
|
|
29
|
+
return isPackageExists("@playwright/test");
|
|
30
|
+
};
|
|
31
|
+
const hasStorybook = () => {
|
|
32
|
+
return isPackageExists("storybook");
|
|
33
|
+
};
|
|
34
|
+
const hasNext = () => {
|
|
35
|
+
return isPackageExists("next");
|
|
36
|
+
};
|
|
37
|
+
const hasVite = () => {
|
|
38
|
+
return isPackageExists("vite");
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
export { hasAstro, hasJest, hasNext, hasPlaywright, hasReact, hasReactQuery, hasStorybook, hasTestingLibrary, hasTypescript, hasVite, hasVitest };
|