Bug 1486739 - Enable ESLint rule comma-dangle for browser/, services/, taskcluster/ and toolkit/ directories. r=mossop

Enable globally by default by blacklist directories outside of the ones we're enabling. Remove now unnecessary existing configurations.

Differential Revision: https://phabricator.services.mozilla.com/D4440

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Banner 2018-08-31 06:06:08 +00:00
Родитель 691543ee89
Коммит afb520e82a
15 изменённых файлов: 29 добавлений и 33 удалений

Просмотреть файл

@ -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",
}
}]
};

Просмотреть файл

@ -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 = () => "<ImageData>";

Просмотреть файл

@ -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],

Просмотреть файл

@ -21,7 +21,6 @@ module.exports = {
"array-bracket-spacing": ["error", "never"],
"block-scoped-var": "error",
"comma-dangle": ["error", "always-multiline"],
complexity: ["error", {
max: 20,
}],

Просмотреть файл

@ -1,7 +0,0 @@
"use strict";
module.exports = {
"rules": {
"comma-dangle": ["error", "always-multiline"],
}
};

Просмотреть файл

@ -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}],

Просмотреть файл

@ -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

Просмотреть файл

@ -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",

Просмотреть файл

@ -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"],

Просмотреть файл

@ -1,7 +0,0 @@
"use strict";
module.exports = {
"rules": {
"comma-dangle": ["error", "always-multiline"],
}
};

Просмотреть файл

@ -7,7 +7,6 @@ module.exports = {
"array-bracket-spacing": ["error", "never"],
"block-scoped-var": "error",
"comma-dangle": ["error", "always-multiline"],
complexity: ["error", {
max: 23,
}],

Просмотреть файл

@ -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}],

Просмотреть файл

@ -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}],

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "eslint-plugin-mozilla",
"version": "0.15.1",
"version": "0.15.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

Просмотреть файл

@ -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",