Skip to content

Commit 897ea39

Browse files
committed
Style fixes for Node 6
Reduce divergence from eslint-config-airbnb-base due to unsupported ES6 features in Node 4. Update code to comply with new rules. Signed-off-by: Kevin Locke <[email protected]>
1 parent 38dd925 commit 897ea39

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

.eslintrc.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,13 @@ rules:
9292
## Requires operator at the beginning of the line in multiline statements
9393
# Airbnb prevents breaks around =, suggesting (). I don't see the advantage.
9494
operator-linebreak: [2, "before"]
95-
## allow use of spread operator, which is not supported in Node v4
96-
prefer-spread: 0
9795
## no space before function, eg. 'function()'
9896
space-before-function-paren: [2, "never"]
9997

10098
# ECMAScript 6 Rules
10199
# list: https://github.com/eslint/eslint/tree/master/docs/rules#ecmascript-6
102100
## require parentheses around arrow function arguments (as Node core does)
103101
arrow-parens: [2, "always"]
104-
## Prefer destructuring from arrays and objects
105-
# Disabled since unsupported on Node < 6
106-
prefer-destructuring: 0
107-
## Suggest using the rest parameters instead of arguments
108-
# Disabled since unsupported on Node < 6
109-
prefer-rest-params: 0
110102

111103
# eslint-plugin-import
112104
## Allow requiring devDependencies in test, test-bin, and test-lib

bin/cmd.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ function parseYargs(yargs, args, callback) {
2222
// are not caught and passed to a second invocation of callback.
2323
let called = false;
2424
try {
25-
yargs.parse(args, function() {
25+
yargs.parse(args, function(...cbargs) {
2626
called = true;
27-
return callback.apply(this, arguments);
27+
return callback.apply(this, cbargs);
2828
});
2929
} catch (err) {
3030
if (called) {

test/helper-unhandled-rejection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ if (typeof process !== 'undefined') {
2727
});
2828
} else {
2929
const oldOHR = window.onunhandledrejection;
30-
window.onunhandledrejection = function(evt) {
31-
if (typeof oldOHR === 'function') { oldOHR.apply(this, arguments); }
30+
window.onunhandledrejection = function(evt, ...args) {
31+
if (typeof oldOHR === 'function') { oldOHR.apply(this, args); }
3232
throw evt.detail.reason;
3333
};
3434
}

0 commit comments

Comments
 (0)