-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy patheslint.config.js
66 lines (61 loc) · 1.74 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import pluginVue from "eslint-plugin-vue";
import vueTsEslintConfig from "@vue/eslint-config-typescript";
import pluginVitest from "@vitest/eslint-plugin";
import skipFormatting from "@vue/eslint-config-prettier/skip-formatting";
export default [
{
name: "app/files-to-lint",
files: ["**/*.{ts,mts,tsx,vue}"],
},
{
name: "app/files-to-ignore",
ignores: ["**/dist/**", "**/dist-ssr/**", "**/coverage/**"],
},
...pluginVue.configs["flat/recommended"],
...vueTsEslintConfig(),
{
...pluginVitest.configs.recommended,
files: ["src/**/__tests__/*"],
},
skipFormatting,
{
rules: {
"no-console": "warn",
"no-debugger": "warn",
"no-var": "error",
"prefer-const": "error",
"no-new-object": "error",
"object-shorthand": "error",
"no-array-constructor": "error",
"prefer-destructuring": "error",
"prefer-template": "error",
"func-style": "error",
"no-loop-func": "error",
"prefer-rest-params": "error",
"default-param-last": "error",
"no-param-reassign": "error",
"prefer-spread": "error",
"prefer-arrow-callback": "error",
"no-duplicate-imports": "error",
"dot-notation": "error",
"no-unneeded-ternary": "error",
"no-warning-comments": "warn",
"no-unused-vars": "off", // Handled by "@typescript-eslint/no-unused-vars"
},
},
{
rules: {
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
},
},
];