forked from brafdlog/caspion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
93 lines (82 loc) · 2.21 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
const globals = require('./globals');
const readonlyGlobals = Object.keys(globals).reduce((acc, key) => {
acc[key] = 'readonly';
return acc;
}, {});
const productionError = process.env.NODE_ENV === 'production' ? 'error' : 'warn';
module.exports = {
root: true,
parserOptions: {
parser: '@typescript-eslint/parser',
sourceType: 'module',
ecmaVersion: 2018
},
env: {
browser: true,
node: true
},
extends: ['airbnb-base', 'plugin:vue/recommended', '@vue/typescript'],
globals: {
__static: 'writable',
...readonlyGlobals,
},
plugins: [
'import',
'vue',
'html',
],
settings: {
'import/core-modules': ['electron'],
'import/resolver': {
alias: {
map: [
['@', './src'],
],
extensions: ['.js', '.ts', '.vue', '.tsx'],
},
},
},
rules: {
// 'no-param-reassign': ['error', { ignorePropertyModificationsFor: ['state'] }],
'no-param-reassign': 'off',
'no-shadow': ['error', { allow: ['state'] }],
'import/extensions': ['off'],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
// allow debugger during development
'no-debugger': productionError,
'no-console': 'off',
'linebreak-style': process.platform === 'win32' ? 0 : 2,
'no-use-before-define': 'off',
'max-len': ['error', { code: 160 }],
'comma-dangle': 'off',
'no-await-in-loop': 'off',
'import/prefer-default-export': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', { args: 'after-used', argsIgnorePattern: '^_|h' }],
'arrow-body-style': 'off',
'object-curly-newline': 'warn',
'semi': productionError,
'padded-blocks': 'off',
'no-return-assign': 'off',
'quote-props': ['error', 'consistent-as-needed'],
'no-restricted-imports': ['error', {
name: 'electron-log',
importNames: ['default'],
message: 'You should import from logging/logger instead'
}]
},
overrides: [
{
files: [
'**/test/**/*.spec.{j,t}s',
'**/*.test.{j,t}s'
],
env: {
jest: true,
},
rules: {
'import/extensions': ['error', { js: 'never', vue: 'always', json: 'always' }]
}
}
],
};