File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
packages/@vue/cli-plugin-eslint Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
- exports . config = api => {
1
+ exports . config = ( api , config ) => {
2
2
const config = {
3
3
root : true ,
4
4
env : { node : true } ,
@@ -8,6 +8,22 @@ exports.config = api => {
8
8
'no-debugger' : makeJSOnlyValue ( `process.env.NODE_ENV === 'production' ? 'error' : 'off'` )
9
9
}
10
10
}
11
+ if ( config === 'airbnb' ) {
12
+ config . rules [ 'no-param-reassign' ] = [ 'error' , {
13
+ props : true ,
14
+ ignorePropertyModificationsFor : [
15
+ 'state' , // for vuex state
16
+ 'acc' , // for reduce accumulators
17
+ 'e' , // for e.returnvalue
18
+ 'ctx' , // for Koa routing
19
+ 'req' , // for Express requests
20
+ 'request' , // for Express requests
21
+ 'res' , // for Express responses
22
+ 'response' , // for Express responses
23
+ '$scope' , // for Angular 1 scopes
24
+ ]
25
+ } ]
26
+ }
11
27
if ( ! api . hasPlugin ( 'typescript' ) ) {
12
28
config . parserOptions = {
13
29
parser : 'babel-eslint'
You can’t perform that action at this time.
0 commit comments