From e16e439d10c71dbe65f862221f4a5b12b2623532 Mon Sep 17 00:00:00 2001 From: Roman Reiss Date: Mon, 25 Jan 2016 22:15:16 +0100 Subject: [PATCH 1/2] tools: enable assorted ESLint error rules Enables assorted rules from the category of possible errors. These should not get in the way in any form. - http://eslint.org/docs/rules/no-control-regex - http://eslint.org/docs/rules/no-extra-boolean-cast - http://eslint.org/docs/rules/no-invalid-regexp - http://eslint.org/docs/rules/no-irregular-whitespace - http://eslint.org/docs/rules/no-unexpected-multiline --- .eslintrc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.eslintrc b/.eslintrc index 8d9988acef7adc..e4dd84b8893da0 100644 --- a/.eslintrc +++ b/.eslintrc @@ -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 From f94f0d50c80b10a581b5b9a8ba651c0145196ea0 Mon Sep 17 00:00:00 2001 From: Roman Reiss Date: Mon, 25 Jan 2016 22:22:14 +0100 Subject: [PATCH 2/2] test: fix irregular whitespace issue --- .../test-promises-unhandled-rejections.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-promises-unhandled-rejections.js b/test/parallel/test-promises-unhandled-rejections.js index 8345096445098c..5da2bff00acaa2 100644 --- a/test/parallel/test-promises-unhandled-rejections.js +++ b/test/parallel/test-promises-unhandled-rejections.js @@ -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( @@ -401,7 +401,7 @@ asyncTest( }); p = Promise.all([p]); process.nextTick(function() { - p.then(common.fail, function() {}); + p.then(common.fail, function() {}); }); } ); @@ -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() {}); }); }); }); @@ -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() {}); }); }); }); @@ -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() {}); }); }); }); @@ -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() {}); }); }); }); @@ -535,7 +535,7 @@ asyncTest( process.nextTick(function() { Promise.resolve().then(function() { process.nextTick(function() { - a.catch(function() {}); + a.catch(function() {}); }); }); }); @@ -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() {}); }); }); });