tools: enable assorted ESLint error rules
authorRoman Reiss <me@silverwind.io>
Mon, 25 Jan 2016 21:15:16 +0000 (22:15 +0100)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
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

PR-URL: https://github.com/nodejs/node/pull/4864
Reviewed-By: targos - Michaƫl Zasso <mic.besace@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
.eslintrc

index 320e86f..c02364e 100644 (file)
--- 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