-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
107 lines (107 loc) · 3.04 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
96
97
98
99
100
101
102
103
104
105
106
107
/*
* Eslint config file
* Documentation: https://eslint.org/docs/user-guide/configuring/
* Install the Eslint extension before using this feature.
*/
module.exports = {
root: true,
extends: [
'eslint:recommended',
],
env: {
es6: true,
browser: true,
node: true,
},
parserOptions: {
ecmaVersion: 13,
sourceType: 'module',
},
globals: {
wx: true,
App: true,
Page: true,
getCurrentPages: true,
getApp: true,
Component: true,
requirePlugin: true,
requireMiniProgram: true,
},
// extends: 'eslint:recommended',
ignorePatterns: [
'script/**/*',
'.eslintrc.js',
],
rules: {
'array-bracket-newline': ['error', { 'multiline': true }],
'array-bracket-spacing': ['error', 'never'],
'arrow-spacing': ['error', {
'before': true,
'after': true,
}],
'brace-style': ['error', '1tbs'],
'camelcase': 'error',
'comma-dangle': ['error', {
'arrays': 'always-multiline',
'objects': 'always-multiline',
'imports': 'always-multiline',
'exports': 'always-multiline',
'functions': 'always-multiline',
}],
'comma-spacing': 'error',
'comma-style': 'error',
'computed-property-spacing': 'error',
'consistent-this': ['error', '_this'],
'curly': ['error', 'all'],
'eol-last': ['error', 'always'],
'func-call-spacing': 'error',
'indent': ['error', 2],
'jsx-quotes': 'error',
'key-spacing': 'error',
'keyword-spacing': 'error',
'line-comment-position': 'error',
'lines-around-comment': 'error',
'lines-between-class-members': 'error',
'max-params': ['error', { 'max': 3 }],
// 'multiline-comment-style': 'error',
// 'new-cap': 'error',
'no-alert': 'error',
'no-console': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-label': 'error',
'no-extra-parens': ['error', 'all', { 'ignoreJSX': 'multi-line' }],
'no-labels': 'error',
'no-lonely-if': 'error',
'no-multi-spaces': ['error', { 'ignoreEOLComments': true }],
'no-multi-assign': 'error',
'no-multiple-empty-lines': 'error',
// 'no-negated-condition': 'error',
'no-param-reassign': 'error',
'no-redeclare': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
// 'no-shadow': 'error',
'no-shadow-restricted-names': 'error',
'no-var': 'error',
'no-trailing-spaces': ['error', { 'ignoreComments': true }],
'no-use-before-define': 'error',
'no-useless-return': 'error',
'no-unneeded-ternary': 'error',
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'require-await': 'error',
'object-shorthand': 'error',
// 'yoda': ['error', 'always'],
'space-before-function-paren': ['error', {
'anonymous': 'always',
'named': 'never',
'asyncArrow': 'always',
}],
'space-infix-ops': 'error',
'object-curly-spacing': ['error', 'always'],
'generator-star-spacing': ['error', { 'before': false, 'after': true }],
'prefer-destructuring': ['error'],
},
}