-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.js
84 lines (83 loc) · 2.11 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
const poi = require('poi');
const app = poi();
const webpackConfig = app.createWebpackConfig();
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module',
ecmaVersion: 2017,
ecmaFeatures: {
jsx: true
},
},
env: {
browser: true,
es6: true,
jest: true,
},
extends: [
'eslint:recommended',
'plugin:vue/recommended',
'plugin:import/errors',
'plugin:import/warnings',
],
plugins: [
'vue',
'import'
],
rules: {
// don't require .vue extension when importing
'import/extensions': ['error', 'always', {
'js': 'never',
'vue': 'never'
}],
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
// no console.log, but can use .warn and .error.
'no-console': ['error', { allow: ['warn', 'error'] }],
// disallow indentation using both tabs and spaces
'no-mixed-spaces-and-tabs': 2,
// ensure consistent 2 space indentation and indent cases under switch
'indent': [2, 2, {'SwitchCase': 1}],
// allow paren-less arrow functions
'arrow-parens': 0,
// allow async-await
'generator-star-spacing': 0,
// require a space before & after certain keywords
'keyword-spacing': ['error', {
before: true,
after: true,
overrides: {
return: { after: true },
throw: { after: true },
case: { after: true }
}
}],
// require or disallow space before function opening parenthesis
'space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}],
// enforce spacing inside array brackets
'array-bracket-spacing': ['error', 'never'],
// trailing comma
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'always-multiline',
}],
// semicolons
'semi': [2, 'always'],
},
settings: {
'import/resolver': {
webpack: {
config: webpackConfig
}
}
}
};