Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools, test: enable assorted ESLint error rules #4864

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ rules:
no-unreachable: 2
## require valid typeof compared string like typeof foo === 'strnig'
valid-typeof: 2
## disallow controls characters in regular expressions
no-control-regex: 2
## disallow extra boolean casts
no-extra-boolean-cast : 2
## validate regular expressions
no-invalid-regexp: 2
## forbid weird whitespace characters
no-irregular-whitespace: 2
## avoid unexpected multiline expressions
no-unexpected-multiline: 2

# Best Practices
# list: https://github.com/eslint/eslint/tree/master/docs/rules#best-practices
Expand Down
16 changes: 8 additions & 8 deletions test/parallel/test-promises-unhandled-rejections.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ asyncTest('Catching the Promise.all() of a collection that includes a' +
'rejected promise prevents unhandledRejection', function(done) {
var e = new Error();
onUnhandledFail(done);
Promise.all([Promise.reject(e)]).then(common.fail, function() {});
Promise.all([Promise.reject(e)]).then(common.fail, function() {});
});

asyncTest(
Expand All @@ -401,7 +401,7 @@ asyncTest(
});
p = Promise.all([p]);
process.nextTick(function() {
p.then(common.fail, function() {});
p.then(common.fail, function() {});
});
}
);
Expand Down Expand Up @@ -455,7 +455,7 @@ asyncTest('Waiting for some combination of process.nextTick + promise' +
Promise.resolve().then(function() {
process.nextTick(function() {
Promise.resolve().then(function() {
a.catch(function() {});
a.catch(function() {});
});
});
});
Expand All @@ -474,7 +474,7 @@ asyncTest('Waiting for some combination of process.nextTick + promise' +
Promise.resolve().then(function() {
process.nextTick(function() {
Promise.resolve().then(function() {
a.catch(function() {});
a.catch(function() {});
});
});
});
Expand All @@ -494,7 +494,7 @@ asyncTest('Waiting for some combination of process.nextTick + promise ' +
Promise.resolve().then(function() {
process.nextTick(function() {
Promise.resolve().then(function() {
a.catch(function() {});
a.catch(function() {});
});
});
});
Expand All @@ -514,7 +514,7 @@ asyncTest('Waiting for some combination of promise microtasks + ' +
process.nextTick(function() {
Promise.resolve().then(function() {
process.nextTick(function() {
a.catch(function() {});
a.catch(function() {});
});
});
});
Expand All @@ -535,7 +535,7 @@ asyncTest(
process.nextTick(function() {
Promise.resolve().then(function() {
process.nextTick(function() {
a.catch(function() {});
a.catch(function() {});
});
});
});
Expand All @@ -556,7 +556,7 @@ asyncTest('Waiting for some combination of promise microtasks +' +
process.nextTick(function() {
Promise.resolve().then(function() {
process.nextTick(function() {
a.catch(function() {});
a.catch(function() {});
});
});
});
Expand Down