forked from creatorsim/creator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.ts
More file actions
143 lines (133 loc) · 4.07 KB
/
Copy patheslint.config.ts
File metadata and controls
143 lines (133 loc) · 4.07 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import pluginVue from "eslint-plugin-vue";
import {
defineConfigWithVueTs,
vueTsConfigs,
} from "@vue/eslint-config-typescript";
import skipFormatting from "@vue/eslint-config-prettier/skip-formatting";
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
// import { configureVueProject } from "@vue/eslint-config-typescript"
// configureVueProject({ scriptLangs: ["ts", "js"] })
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
export default defineConfigWithVueTs(
{
name: "app/files-to-lint",
files: ["**/*.{ts,mts,tsx,vue}"],
},
{
name: "app/files-to-ignore",
ignores: ["**/dist/**", "**/dist-ssr/**", "**/coverage/**"],
},
pluginVue.configs["flat/essential"],
vueTsConfigs.recommended,
skipFormatting,
{
rules: {
"max-lines-per-function": [
"warn",
{
max: 100,
skipBlankLines: true,
skipComments: true,
},
],
eqeqeq: ["error", "always"],
"max-depth": ["warn", 5],
"prefer-const": "warn",
"no-loss-of-precision": "error",
"no-unreachable-loop": "error",
"no-var": "error",
"no-useless-return": "warn",
"no-warning-comments": "off",
"operator-assignment": ["warn", "always"],
"prefer-regex-literals": "warn",
"prefer-rest-params": "error",
"prefer-spread": "warn",
radix: "warn",
"require-await": "error",
yoda: "warn",
"no-constructor-return": "error",
"no-duplicate-imports": "warn",
"no-inner-declarations": "error",
"no-self-compare": "error",
"no-template-curly-in-string": "warn",
"no-unmodified-loop-condition": "error",
"no-use-before-define": ["error", { functions: false }],
"no-useless-assignment": "warn",
"require-atomic-updates": "warn",
"class-methods-use-this": "warn",
"consistent-return": "error",
"default-case": "error",
"default-case-last": "warn",
"dot-notation": "error",
"max-params": ["warn", 6],
"no-div-regex": "error",
"no-implicit-coercion": "error",
"no-invalid-this": "error",
"no-iterator": "error",
"no-lone-blocks": "warn",
"no-multi-assign": "error",
"no-nested-ternary": "warn",
"no-new": "error",
"default-param-last": "warn",
"func-names": ["warn", "never", { generators: "as-needed" }],
"func-style": ["warn", "declaration", { allowArrowFunctions: true }],
"guard-for-in": "error",
"prefer-object-has-own": "error",
"no-alert": "error",
"no-array-constructor": "error",
"no-lonely-if": "warn",
"no-useless-concat": "warn",
"no-void": "error",
"object-shorthand": ["warn", "always", { avoidQuotes: true }],
"prefer-exponentiation-operator": "warn",
"prefer-numeric-literals": "warn",
"prefer-object-spread": "warn",
strict: "warn",
/* TypeScript */
"@typescript-eslint/no-unused-vars": [
"warn",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"@typescript-eslint/ban-ts-comment": [
"warn",
{
"ts-ignore": "allow-with-description",
},
],
/* Vue */
"vue/no-unused-components": "warn",
"vue/multi-word-component-names": "off",
"vue/block-lang": [
"error",
{
script: {
lang: "ts",
allowNoLang: true,
},
},
],
"vue/valid-v-for": "off",
"vue/no-unused-vars": [
"warn",
{
ignorePattern: "^_",
},
],
},
},
{
files: ["**/*.vue"],
rules: {
"no-invalid-this": "off", // in Vue, inside arrow functions, `this` refers to the current component
"@typescript-eslint/no-explicit-any": "off", // for stuff like this.$root... we need to use this...
},
},
);