diff --git a/.eslintrc.js b/.eslintrc.js index 451de6c6f302..bf45f137959c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -39,5 +39,27 @@ module.exports = { "env": { "mozilla/browser-window": true } + }, { + // XXX Bug 1486741 - We've not rolled out comma-dangle to these directories + // yet, so turn it off for now. + "files": [ + "accessible/**", + "caps/**", + "chrome/**", + "devtools/**", + "dom/**", + "extensions/**", + "intl/**", + "js/**", + "mobile/**", + "security/**", + "storage/**", + "testing/**", + "tools/**", + "xpcom/**", + ], + "rules": { + "comma-dangle": "off", + } }] }; diff --git a/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js b/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js index ba18e27a3607..b469342d8e57 100644 --- a/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js +++ b/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js @@ -28,7 +28,7 @@ add_task(async function testDetailsObjects() { green: getImageData("green"), }; - /* eslint-disable comma-dangle, indent, indent-legacy */ + /* eslint-disable indent, indent-legacy */ let iconDetails = [ // Only paths. {details: {"path": "a.png"}, @@ -166,6 +166,7 @@ add_task(async function testDetailsObjects() { "1": browser.runtime.getURL("data/32.png"), "2": browser.runtime.getURL("data/32.png")}}, ]; + /* eslint-enable indent, indent-legacy */ // Allow serializing ImageData objects for logging. ImageData.prototype.toJSON = () => ""; diff --git a/browser/components/migration/.eslintrc.js b/browser/components/migration/.eslintrc.js index a45ee44612d4..09b2e4b753cd 100644 --- a/browser/components/migration/.eslintrc.js +++ b/browser/components/migration/.eslintrc.js @@ -3,7 +3,6 @@ module.exports = { "rules": { "block-scoped-var": "error", - "comma-dangle": ["error", "always-multiline"], "complexity": ["error", {"max": 22}], "indent-legacy": ["error", 2, {"SwitchCase": 1, "ArrayExpression": "first", "ObjectExpression": "first"}], "max-nested-callbacks": ["error", 3], diff --git a/browser/components/payments/.eslintrc.js b/browser/components/payments/.eslintrc.js index a885616d9761..6e937bfc0247 100644 --- a/browser/components/payments/.eslintrc.js +++ b/browser/components/payments/.eslintrc.js @@ -21,7 +21,6 @@ module.exports = { "array-bracket-spacing": ["error", "never"], "block-scoped-var": "error", - "comma-dangle": ["error", "always-multiline"], complexity: ["error", { max: 20, }], diff --git a/browser/components/places/.eslintrc.js b/browser/components/places/.eslintrc.js deleted file mode 100644 index b979e67dd018..000000000000 --- a/browser/components/places/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -module.exports = { - "rules": { - "comma-dangle": ["error", "always-multiline"], - } -}; diff --git a/browser/extensions/formautofill/.eslintrc.js b/browser/extensions/formautofill/.eslintrc.js index c240d753c11d..13afaca083fd 100644 --- a/browser/extensions/formautofill/.eslintrc.js +++ b/browser/extensions/formautofill/.eslintrc.js @@ -55,10 +55,6 @@ module.exports = { // since only let and const are used, see "no-var"). "block-scoped-var": "error", - // Allow trailing commas for easy list extension. Having them does not - // impair readability, but also not required either. - "comma-dangle": ["error", "always-multiline"], - // Warn about cyclomatic complexity in functions. "complexity": ["error", {"max": 26}], diff --git a/devtools/.eslintrc.js b/devtools/.eslintrc.js index 7773defa2fde..95778524828d 100644 --- a/devtools/.eslintrc.js +++ b/devtools/.eslintrc.js @@ -238,9 +238,6 @@ module.exports = { "brace-style": ["error", "1tbs", {"allowSingleLine": false}], // Require camel case names "camelcase": "error", - // Allow trailing commas for easy list extension. Having them does not - // impair readability, but also not required either. - "comma-dangle": "off", // Warn about cyclomatic complexity in functions. "complexity": ["error", 53], // Don't warn for inconsistent naming when capturing this (not so important diff --git a/toolkit/components/extensions/.eslintrc.js b/toolkit/components/extensions/.eslintrc.js index 19fd5f07509e..511d5d08e334 100644 --- a/toolkit/components/extensions/.eslintrc.js +++ b/toolkit/components/extensions/.eslintrc.js @@ -109,10 +109,6 @@ module.exports = { // since only let and const are used, see "no-var"). "block-scoped-var": "error", - // Allow trailing commas for easy list extension. Having them does not - // impair readability, but also not required either. - "comma-dangle": ["error", "always-multiline"], - // Warn about cyclomatic complexity in functions. "complexity": "error", diff --git a/toolkit/components/narrate/.eslintrc.js b/toolkit/components/narrate/.eslintrc.js index 38d8a6b4ad02..33060dbe0dca 100644 --- a/toolkit/components/narrate/.eslintrc.js +++ b/toolkit/components/narrate/.eslintrc.js @@ -7,7 +7,6 @@ module.exports = { "mozilla/var-only-at-top-level": "error", "block-scoped-var": "error", "camelcase": "error", - "comma-dangle": "off", "complexity": ["error", {"max": 20}], "curly": "error", "dot-location": ["error", "property"], diff --git a/toolkit/components/places/.eslintrc.js b/toolkit/components/places/.eslintrc.js deleted file mode 100644 index b979e67dd018..000000000000 --- a/toolkit/components/places/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -module.exports = { - "rules": { - "comma-dangle": ["error", "always-multiline"], - } -}; diff --git a/toolkit/components/satchel/.eslintrc.js b/toolkit/components/satchel/.eslintrc.js index f4ccf5a25970..5883b0a651da 100644 --- a/toolkit/components/satchel/.eslintrc.js +++ b/toolkit/components/satchel/.eslintrc.js @@ -7,7 +7,6 @@ module.exports = { "array-bracket-spacing": ["error", "never"], "block-scoped-var": "error", - "comma-dangle": ["error", "always-multiline"], complexity: ["error", { max: 23, }], diff --git a/tools/lint/eslint/.eslintrc.js b/tools/lint/eslint/.eslintrc.js index 2c44f6ac6376..8807ee0cfd80 100644 --- a/tools/lint/eslint/.eslintrc.js +++ b/tools/lint/eslint/.eslintrc.js @@ -16,7 +16,6 @@ module.exports = { "rules": { "camelcase": "error", - "comma-dangle": ["error", "never"], "curly": ["error", "multi-line"], "handle-callback-err": ["error", "er"], "indent-legacy": ["error", 2, {"SwitchCase": 1}], diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js index ed12ea856501..d77cdcd4dc26 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js @@ -116,6 +116,9 @@ module.exports = { // No newline before open brace for a block "brace-style": ["error", "1tbs", { "allowSingleLine": true }], + // Require trailing commas for easy list extension and consistent style. + "comma-dangle": ["error", "always-multiline"], + // No space before always a space after a comma "comma-spacing": ["error", {"after": true, "before": false}], diff --git a/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json b/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json index 7e766d85e4d6..22d6c91d56ef 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json +++ b/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-mozilla", - "version": "0.15.1", + "version": "0.15.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/tools/lint/eslint/eslint-plugin-mozilla/package.json b/tools/lint/eslint/eslint-plugin-mozilla/package.json index 4bba2356ab5b..2096c63114d5 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/package.json +++ b/tools/lint/eslint/eslint-plugin-mozilla/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-mozilla", - "version": "0.15.1", + "version": "0.15.3", "description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.", "keywords": [ "eslint",