-
Notifications
You must be signed in to change notification settings - Fork 8
/
.eslintrc.json
118 lines (116 loc) · 3.4 KB
/
.eslintrc.json
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
{
"env": {
"browser": true,
"es2021": true
},
"overrides": [
{
"files": ["*.json", "*.json5"],
"extends": [
"eslint:recommended",
"airbnb-base",
"plugin:@intlify/vue-i18n/recommended",
"prettier"
]
},
{
"files": ["*.ts", "*.js", "*.vue"],
"extends": [
"airbnb-base",
"airbnb-typescript/base",
"@nuxtjs/eslint-config-typescript",
"plugin:promise/recommended",
"plugin:@intlify/vue-i18n/recommended",
"plugin:vitest/recommended",
"prettier"
],
"rules": {
"@intlify/vue-i18n/no-raw-text": [
"warn",
{
"attributes": {
"/.+/": [
"title",
"aria-label",
"aria-placeholder",
"aria-roledescription",
"aria-valuetext"
],
"input": ["placeholder"],
"img": ["alt"]
}
}
],
"no-param-reassign": ["error", { "props": false }],
"@typescript-eslint/consistent-type-assertions": [
"warn",
{ "assertionStyle": "never" }
],
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"promise/always-return": "off"
}
},
{
"files": ["*.spec.ts"],
"rules": {
// Sometimes its too much of a hassle to implement the full type, so we want to cast and object having a subset of it.
"@typescript-eslint/consistent-type-assertions": "off",
// If I want an element to exist and the system to throw if not found. Useful when searching for UI elements to act on.
"@typescript-eslint/no-non-null-assertion": "off",
// If it doesn't exist or has the wrong type, the test should fail. Added to support calling methods of ".vue" files.
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-member-access": "off"
}
},
{
"files": ["vitest.config.ts", "cypress.config.ts", "cypress/**/*.ts"],
"rules": {
"vitest/expect-expect": "off",
"import/no-extraneous-dependencies": [
"error",
{ "devDependencies": true }
]
}
},
{
"files": ["stores/**/*.ts", "composables/**/*.ts"],
"rules": {
"import/prefer-default-export": "off"
}
},
{
"files": ["electron/**/*.ts"],
"rules": {
"import/no-extraneous-dependencies": "off"
}
}
],
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser",
"ecmaVersion": "latest",
"project": ["tsconfig.json"],
"extraFileExtensions": [".vue"]
},
"plugins": ["vue", "@typescript-eslint", "vitest"],
"rules": {
"@intlify/vue-i18n/valid-message-syntax": "warn",
"@intlify/vue-i18n/no-duplicate-keys-in-locale": "warn",
"@intlify/vue-i18n/no-missing-keys-in-other-locales": "warn",
"@intlify/vue-i18n/no-raw-text": "warn",
"@intlify/vue-i18n/no-dynamic-keys": "warn",
"@intlify/vue-i18n/no-unused-keys": [
"warn",
{ "extensions": [".vue", ".ts"] }
],
"vue/no-v-html": "off"
},
"settings": {
"import/core-modules": ["#app"],
"vue-i18n": {
"localeDir": "./locales/*.json"
}
}
}