-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
76 lines (75 loc) · 2.21 KB
/
.eslintrc.cjs
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
// Typescript lint rules that we don't need
const customTSRules = {
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-explicit-any': 'warn', // We need to use any for some cases, so it just a warning until we can suppress it
'no-undef': 'off' // It will be handled by typescript, so we don't need it
}
module.exports = {
root: true,
env: {
browser: true,
es2022: true,
webextensions: true
},
extends: [
'standard',
'prettier',
'plugin:prettier/recommended'
// 'eslint:recommended'
],
overrides: [
{
// Rules for typescript files
files: ['**/*.{ts,tsx,mts,cts}'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'standard',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended'
],
rules: {
...customTSRules
}
},
{
// Rules for vue files
files: ['**/*.vue'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
sourceType: 'module'
},
extends: [
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended',
'@unocss'
],
rules: {
// Vue rules that we don't need
'vue/multi-word-component-names': 'off', // No needed for most of usage
'vue/html-indent': 'off', // handled by prettier
'vue/no-unused-vars': 'warn',
...customTSRules
}
}
],
// parserOptions: {
// ecmaVersion: 'latest',
// sourceType: 'module',
// parser: '@babel/eslint-parser'
// },
rules: {
'linebreak-style': ['error', 'unix'],
'prettier/prettier': [
'error',
{
tabWidth: 4
}
],
semi: ['error', 'never']
}
}