Bug 1355778 - Unify some of the eslint-plugin-* rules to match the Mozilla recommended configuration. r?Mossop draft
authorMark Banner <standard8@mozilla.com>
Wed, 12 Apr 2017 12:14:43 +0100
changeset 561273 75dd7c11e202c3e5222ce869076014aaafe5510c
parent 560921 f40e24f40b4c4556944c762d4764eace261297f5
child 561274 66f5da0cd8de8a1075b28425ecb4a972a218e829
push id53679
push userbmo:standard8@mozilla.com
push dateWed, 12 Apr 2017 11:22:10 +0000
reviewersMossop
bugs1355778
milestone55.0a1
Bug 1355778 - Unify some of the eslint-plugin-* rules to match the Mozilla recommended configuration. r?Mossop MozReview-Commit-ID: IyLtlZCtMtH
tools/lint/eslint/.eslintrc.js
--- a/tools/lint/eslint/.eslintrc.js
+++ b/tools/lint/eslint/.eslintrc.js
@@ -9,37 +9,40 @@
  *   - Functions should not have whitespace before params.
  */
 
 module.exports = {
   "env": {
     "node": true
   },
 
+  "plugins": [
+    "mozilla"
+  ],
+
+  "extends": [
+    "plugin:mozilla/recommended"
+  ],
+
   "rules": {
-    "brace-style": ["error", "1tbs"],
     "camelcase": "error",
     "comma-dangle": ["error", "never"],
-    "comma-spacing": "error",
     "comma-style": ["error", "last"],
     "curly": ["error", "multi-line"],
     "handle-callback-err": ["error", "er"],
     "indent": ["error", 2, {"SwitchCase": 1}],
-    "max-len": ["error", 80, 2],
+    // Longer max-len due to AST selectors
+    "max-len": ["error", 150, 2],
     "no-multiple-empty-lines": ["error", {"max": 1}],
-    "no-undef": "error",
+    "no-shadow": "error",
     "no-undef-init": "error",
-    "no-unexpected-multiline": "error",
     "object-curly-spacing": "off",
     "one-var": ["error", "never"],
     "operator-linebreak": ["error", "after"],
     "semi": ["error", "always"],
-    "space-before-blocks": "error",
-    "space-before-function-paren": ["error", "never"],
-    "keyword-spacing": "error",
     "strict": ["error", "global"],
   },
 
   // Globals accessible within node modules.
   "globals": {
     "DTRACE_HTTP_CLIENT_REQUEST": true,
     "DTRACE_HTTP_CLIENT_RESPONSE": true,
     "DTRACE_HTTP_SERVER_REQUEST": true,