@curev/eslint-config 0.3.0 → 0.3.2
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/chunk-TMQW6NVO.js +69 -0
- package/dist/dist-LIAOFFCU.js +226696 -0
- package/dist/index.cjs +228966 -0
- package/dist/index.d.cts +516 -0
- package/dist/index.d.ts +516 -0
- package/dist/index.js +2155 -0
- package/package.json +8 -5
- package/.eslintignore +0 -1
- package/.github/workflows/release.yml +0 -37
- package/.vscode/settings.json +0 -36
- package/CHANGELOG.md +0 -740
- package/eslint.config.ts +0 -3
- package/fixtures/input/css.css +0 -10
- package/fixtures/input/html.html +0 -17
- package/fixtures/input/javascript.js +0 -69
- package/fixtures/input/jsx.jsx +0 -27
- package/fixtures/input/markdown.md +0 -34
- package/fixtures/input/svelte.svelte +0 -8
- package/fixtures/input/toml.toml +0 -23
- package/fixtures/input/tsx.tsx +0 -32
- package/fixtures/input/typescript.ts +0 -84
- package/fixtures/input/vue-ts.vue +0 -35
- package/fixtures/input/vue.vue +0 -27
- package/fixtures/output/all/javascript.js +0 -72
- package/fixtures/output/all/jsx.jsx +0 -26
- package/fixtures/output/all/markdown.md +0 -33
- package/fixtures/output/all/svelte.svelte +0 -8
- package/fixtures/output/all/toml.toml +0 -23
- package/fixtures/output/all/tsx.tsx +0 -32
- package/fixtures/output/all/typescript.ts +0 -83
- package/fixtures/output/all/vue-ts.vue +0 -35
- package/fixtures/output/all/vue.vue +0 -24
- package/fixtures/output/js/javascript.js +0 -72
- package/fixtures/output/js/markdown.md +0 -33
- package/fixtures/output/js/toml.toml +0 -23
- package/fixtures/output/no-markdown-with-formatters/javascript.js +0 -72
- package/fixtures/output/no-markdown-with-formatters/jsx.jsx +0 -24
- package/fixtures/output/no-markdown-with-formatters/markdown.md +0 -33
- package/fixtures/output/no-markdown-with-formatters/toml.toml +0 -23
- package/fixtures/output/no-markdown-with-formatters/tsx.tsx +0 -23
- package/fixtures/output/no-markdown-with-formatters/typescript.ts +0 -83
- package/fixtures/output/no-style/javascript.js +0 -72
- package/fixtures/output/no-style/jsx.jsx +0 -21
- package/fixtures/output/no-style/toml.toml +0 -23
- package/fixtures/output/no-style/typescript.ts +0 -80
- package/fixtures/output/no-style/vue-ts.vue +0 -35
- package/fixtures/output/no-style/vue.vue +0 -24
- package/fixtures/output/tab-double-quotes/javascript.js +0 -72
- package/fixtures/output/tab-double-quotes/jsx.jsx +0 -26
- package/fixtures/output/tab-double-quotes/markdown.md +0 -33
- package/fixtures/output/tab-double-quotes/toml.toml +0 -23
- package/fixtures/output/tab-double-quotes/tsx.tsx +0 -32
- package/fixtures/output/tab-double-quotes/typescript.ts +0 -83
- package/fixtures/output/tab-double-quotes/vue-ts.vue +0 -35
- package/fixtures/output/tab-double-quotes/vue.vue +0 -24
- package/fixtures/output/ts-override/javascript.js +0 -72
- package/fixtures/output/ts-override/jsx.jsx +0 -26
- package/fixtures/output/ts-override/markdown.md +0 -33
- package/fixtures/output/ts-override/toml.toml +0 -23
- package/fixtures/output/ts-override/tsx.tsx +0 -32
- package/fixtures/output/ts-override/typescript.ts +0 -83
- package/fixtures/output/ts-override/vue-ts.vue +0 -35
- package/fixtures/output/ts-override/vue.vue +0 -24
- package/fixtures/output/with-formatters/css.css +0 -11
- package/fixtures/output/with-formatters/html.html +0 -28
- package/fixtures/output/with-formatters/javascript.js +0 -72
- package/fixtures/output/with-formatters/jsx.jsx +0 -26
- package/fixtures/output/with-formatters/markdown.md +0 -34
- package/fixtures/output/with-formatters/toml.toml +0 -23
- package/fixtures/output/with-formatters/tsx.tsx +0 -32
- package/fixtures/output/with-formatters/typescript.ts +0 -83
- package/fixtures/output/with-formatters/vue-ts.vue +0 -38
- package/fixtures/output/with-formatters/vue.vue +0 -24
- package/src/configs/comments.ts +0 -19
- package/src/configs/formatters.ts +0 -187
- package/src/configs/ignores.ts +0 -10
- package/src/configs/imports.ts +0 -46
- package/src/configs/index.ts +0 -21
- package/src/configs/javascript.ts +0 -277
- package/src/configs/jsdoc.ts +0 -41
- package/src/configs/jsonc.ts +0 -86
- package/src/configs/markdown.ts +0 -110
- package/src/configs/node.ts +0 -24
- package/src/configs/perfectionist.ts +0 -18
- package/src/configs/react.ts +0 -111
- package/src/configs/sort.ts +0 -223
- package/src/configs/stylistic.ts +0 -52
- package/src/configs/svelte.ts +0 -107
- package/src/configs/test.ts +0 -54
- package/src/configs/toml.ts +0 -72
- package/src/configs/typescript.ts +0 -171
- package/src/configs/unicorn.ts +0 -41
- package/src/configs/unocss.ts +0 -43
- package/src/configs/vue.ts +0 -170
- package/src/configs/yaml.ts +0 -72
- package/src/factory.ts +0 -255
- package/src/globs.ts +0 -81
- package/src/index.ts +0 -9
- package/src/plugins.ts +0 -10
- package/src/stub.d.ts +0 -3
- package/src/types.ts +0 -364
- package/src/utils.ts +0 -76
- package/src/vender/prettier-types.ts +0 -136
- package/test/cli.spec.ts +0 -90
- package/test/fixtures.test.ts +0 -127
- package/tsconfig.json +0 -17
- package/tsup.config.ts +0 -8
package/test/fixtures.test.ts
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { join, resolve } from "node:path";
|
|
2
|
-
import { afterAll, beforeAll, it } from "vitest";
|
|
3
|
-
import fs from "fs-extra";
|
|
4
|
-
import { execa } from "execa";
|
|
5
|
-
import fg from "fast-glob";
|
|
6
|
-
import type { FlatConfigItem, OptionsConfig } from "../src/types";
|
|
7
|
-
|
|
8
|
-
beforeAll(async () => {
|
|
9
|
-
await fs.rm("_fixtures", { recursive: true, force: true });
|
|
10
|
-
});
|
|
11
|
-
afterAll(async () => {
|
|
12
|
-
await fs.rm("_fixtures", { recursive: true, force: true });
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
runWithConfig("js", {
|
|
16
|
-
typescript: false,
|
|
17
|
-
vue: false
|
|
18
|
-
});
|
|
19
|
-
runWithConfig("all", {
|
|
20
|
-
typescript: true,
|
|
21
|
-
vue: true,
|
|
22
|
-
svelte: true
|
|
23
|
-
});
|
|
24
|
-
runWithConfig("no-style", {
|
|
25
|
-
typescript: true,
|
|
26
|
-
vue: true,
|
|
27
|
-
stylistic: false
|
|
28
|
-
});
|
|
29
|
-
runWithConfig(
|
|
30
|
-
"tab-double-quotes",
|
|
31
|
-
{
|
|
32
|
-
typescript: true,
|
|
33
|
-
vue: true,
|
|
34
|
-
stylistic: {
|
|
35
|
-
indent: "tab",
|
|
36
|
-
quotes: "double"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
rules: {
|
|
41
|
-
"style/no-mixed-spaces-and-tabs": "off"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
// https://github.com/antfu/eslint-config/issues/255
|
|
47
|
-
runWithConfig(
|
|
48
|
-
"ts-override",
|
|
49
|
-
{
|
|
50
|
-
typescript: true
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
rules: {
|
|
54
|
-
"ts/consistent-type-definitions": ["error", "type"]
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
runWithConfig(
|
|
60
|
-
"with-formatters",
|
|
61
|
-
{
|
|
62
|
-
typescript: true,
|
|
63
|
-
vue: true,
|
|
64
|
-
formatters: true
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
runWithConfig(
|
|
69
|
-
"no-markdown-with-formatters",
|
|
70
|
-
{
|
|
71
|
-
jsx: false,
|
|
72
|
-
vue: false,
|
|
73
|
-
markdown: false,
|
|
74
|
-
formatters: {
|
|
75
|
-
markdown: true
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
function runWithConfig(name: string, configs: OptionsConfig, ...items: FlatConfigItem[]) {
|
|
81
|
-
it.concurrent(name, async ({ expect }) => {
|
|
82
|
-
const from = resolve("fixtures/input");
|
|
83
|
-
const output = resolve("fixtures/output", name);
|
|
84
|
-
const target = resolve("_fixtures", name);
|
|
85
|
-
|
|
86
|
-
await fs.copy(from, target, {
|
|
87
|
-
filter: (src) => {
|
|
88
|
-
return !src.includes("node_modules");
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
await fs.writeFile(join(target, "eslint.config.js"), `
|
|
92
|
-
// @eslint-disable
|
|
93
|
-
import antfu from '@antfu/eslint-config'
|
|
94
|
-
|
|
95
|
-
export default antfu(
|
|
96
|
-
${JSON.stringify(configs)},
|
|
97
|
-
...${JSON.stringify(items) ?? []},
|
|
98
|
-
)
|
|
99
|
-
`);
|
|
100
|
-
|
|
101
|
-
await execa("npx", ["eslint", ".", "--fix"], {
|
|
102
|
-
cwd: target,
|
|
103
|
-
stdio: "pipe"
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
const files = await fg("**/*", {
|
|
107
|
-
ignore: [
|
|
108
|
-
"node_modules",
|
|
109
|
-
"eslint.config.js"
|
|
110
|
-
],
|
|
111
|
-
cwd: target
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
await Promise.all(files.map(async (file) => {
|
|
115
|
-
const content = await fs.readFile(join(target, file), "utf-8");
|
|
116
|
-
const source = await fs.readFile(join(from, file), "utf-8");
|
|
117
|
-
const outputPath = join(output, file);
|
|
118
|
-
if (content === source) {
|
|
119
|
-
if (fs.existsSync(outputPath)) {
|
|
120
|
-
fs.remove(outputPath);
|
|
121
|
-
}
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
await expect.soft(content).toMatchFileSnapshot(join(output, file));
|
|
125
|
-
}));
|
|
126
|
-
}, 30_000);
|
|
127
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es2020",
|
|
4
|
-
"baseUrl": ".",
|
|
5
|
-
"module": "es2020",
|
|
6
|
-
"moduleResolution": "Bundler",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"skipLibCheck": true
|
|
10
|
-
},
|
|
11
|
-
"include": [
|
|
12
|
-
"**/*.ts"
|
|
13
|
-
],
|
|
14
|
-
"exclude": [
|
|
15
|
-
"./fixtures/**/*.*"
|
|
16
|
-
]
|
|
17
|
-
}
|