Skip to content

Commit

Permalink
build(eslint): enable usage of the "spread" operator (dequelabs#1034)
Browse files Browse the repository at this point in the history
The patch updates our ESLint configs and instructs ESLint to enable ECMA v9 features (including the spread `...` operator).

Additionally, a random usage of `Object.assign()` has been replaced by the spread operator to ensure this is working as expected.
  • Loading branch information
stephenmathieson authored Jul 31, 2018
1 parent f6f08d4 commit 77887aa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": ["prettier"],
"parserOptions":{
"ecmaVersion": 9
},
"env": {
"node": true
},
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/chrome-debugging-protocol/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"es6": true
},
"parserOptions": {
"ecmaVersion": 8
"ecmaVersion": 9
}
}
2 changes: 1 addition & 1 deletion doc/examples/puppeteer/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"es6": true
},
"parserOptions": {
"ecmaVersion": 8
"ecmaVersion": 9
}
}
9 changes: 1 addition & 8 deletions lib/core/base/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ function getDefaultConfiguration(audit) {
config.reporter = config.reporter || null;
config.rules = config.rules || [];
config.checks = config.checks || [];
config.data = Object.assign(
{
checks: {},
rules: {}
},
config.data
);

config.data = { checks: {}, rules: {}, ...config.data };
return config;
}

Expand Down

0 comments on commit 77887aa

Please sign in to comment.