-
Notifications
You must be signed in to change notification settings - Fork 8
/
.eslintrc.js
95 lines (79 loc) · 2.42 KB
/
.eslintrc.js
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
/* eslint-env node */
const { resolve } = require('path');
const baseRules = {
'prefer-promise-reject-errors': 'off',
// General syntax
'quotes': ['warn', 'single', { avoidEscape: true }],
'no-tabs': ['error', { allowIndentationTabs: true }],
'indent': ['error', 'tab'],
'max-len': ['error', { ignoreUrls: true, code: 120 }],
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0, maxBOF: 1 }],
'no-trailing-spaces': ['error'],
'space-in-parens': ['error', 'never'],
'object-curly-spacing': ['error', 'always'],
'template-curly-spacing': ['error', 'never'],
'comma-spacing': ['error', { before: false, after: true }],
'semi': ['error', 'always'],
'generator-star-spacing': 'off',
'arrow-parens': 'off',
'one-var': 'off',
'no-void': 'off',
'multiline-ternary': 'off',
'space-infix-ops': ['error'],
'keyword-spacing': ['error'],
'space-before-blocks': ['error', 'always'],
'arrow-spacing': ['error'],
// allow console and debugger during development only
'no-console': process.env.NODE_ENV === 'development' ? 'off' : 'error',
'no-debugger': process.env.NODE_ENV === 'development' ? 'off' : 'error'
};
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module' // Allows for the use of imports
},
env: {
browser: true
},
extends: [
'eslint:recommended',
'prettier'
],
globals: {
__statics: 'readonly',
process: 'readonly'
},
rules: baseRules,
overrides: [{
files: ['*.ts', '*.tsx', '*.vue'],
parserOptions: {
extraFileExtensions: ['.vue'],
parser: '@typescript-eslint/parser',
project: resolve(__dirname, './tsconfig.json'),
tsconfigRootDir: __dirname,
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module' // Allows for the use of imports
},
// Rules order is important, please avoid shuffling them
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
// consider disabling this class of rules if linting takes too long
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:vue/vue3-essential',
'prettier'
],
plugins: [
'@typescript-eslint',
'vue'
],
rules: {
...baseRules,
// TypeScript
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/space-infix-ops': ['error'],
}
}],
};