-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
54 lines (54 loc) · 1.66 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
/*
npm init @eslint/config
npx eslint src/main.ts
*/
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
],
'root': true,
// parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: true,
// project: ['tsconfig.json']
},
plugins: [
'@typescript-eslint',
'vue'
],
rules: {
'@typescript-eslint/comma-dangle': 'off',
'@typescript-eslint/semi': 'off',
'arrow-spacing': ['error', { before: true, after: true }],
'block-spacing': 'error',
'brace-style': ['error', '1tbs', { allowSingleLine: false }],
'comma-dangle': ['error', 'always-multiline'],
curly: ['error', 'all'],
'import/no-absolute-path': 'off',
indent: ['error', 2, { SwitchCase: 1 }],
'key-spacing': ['error', { afterColon: true, beforeColon: false }],
'keyword-spacing': ['error', { before: true }],
'max-len': ['error', { code: 120 }],
'no-console': process.env.PROD ? 'warn' : 'off',
'no-debugger': process.env.PROD ? 'warn' : 'off',
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-undef': process.env.PROD ? 'error' : 'warn',
'no-unreachable': process.env.PROD ? 'error' : 'warn',
'no-unused-vars': process.env.PROD ? 'error' : 'warn',
'object-curly-spacing': ['error', 'always'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'space-before-blocks': ['error', 'always'],
'space-infix-ops': ['error', { int32Hint: false }],
},
};