-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.cjs
82 lines (82 loc) · 2.4 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
77
78
79
80
81
82
module.exports = {
env: {
es6: true,
node: true,
browser: true,
// obsidian: true, TODO,one-eslint
},
extends: [
'plugin:vue/base',
'eslint:recommended',
'plugin:import/recommended',
'plugin:vue/vue3-recommended',
'plugin:vue/essential',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'eslint-config-prettier',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:import/typescript',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
activeDocument: 'readonly',
app: 'readonly',
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.vue'],
// TODO 在工作区中,指定此目录会导致无法正常工作
// tsconfigRootDir: './',
// project: './tsconfig.json',
ecmaVersion: 6,
sourceType: 'module',
jsx: true,
ecmaFeatures: {
modules: true,
jsx: true,
},
},
plugins: ['@typescript-eslint', 'import'],
rules: {
// TODO
'import/no-unresolved': ['error', { ignore: ['^virtual:'] }],
'vue/multi-word-component-names': 1,
'vue/no-v-model-argument': 'off',
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single', { avoidEscape: true }],
'@typescript-eslint/no-unused-vars': 0, // Configured in tsconfig instead.
'no-unused-vars': 0, // Configured in tsconfig instead.
'prettier/prettier': [
'error',
{
trailingComma: 'all',
printWidth: 120,
tabWidth: 4,
useTabs: false,
singleQuote: true,
bracketSpacing: true,
},
],
semi: ['error', 'always'],
'import/order': 'error',
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: ['tsconfig.json', 'other-packages/*/tsconfig.json'],
},
},
},
};