зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
691543ee89
Коммит
afb520e82a
22
.eslintrc.js
22
.eslintrc.js
|
@ -39,5 +39,27 @@ module.exports = {
|
||||||
"env": {
|
"env": {
|
||||||
"mozilla/browser-window": true
|
"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"),
|
green: getImageData("green"),
|
||||||
};
|
};
|
||||||
|
|
||||||
/* eslint-disable comma-dangle, indent, indent-legacy */
|
/* eslint-disable indent, indent-legacy */
|
||||||
let iconDetails = [
|
let iconDetails = [
|
||||||
// Only paths.
|
// Only paths.
|
||||||
{details: {"path": "a.png"},
|
{details: {"path": "a.png"},
|
||||||
|
@ -166,6 +166,7 @@ add_task(async function testDetailsObjects() {
|
||||||
"1": browser.runtime.getURL("data/32.png"),
|
"1": browser.runtime.getURL("data/32.png"),
|
||||||
"2": browser.runtime.getURL("data/32.png")}},
|
"2": browser.runtime.getURL("data/32.png")}},
|
||||||
];
|
];
|
||||||
|
/* eslint-enable indent, indent-legacy */
|
||||||
|
|
||||||
// Allow serializing ImageData objects for logging.
|
// Allow serializing ImageData objects for logging.
|
||||||
ImageData.prototype.toJSON = () => "<ImageData>";
|
ImageData.prototype.toJSON = () => "<ImageData>";
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"rules": {
|
"rules": {
|
||||||
"block-scoped-var": "error",
|
"block-scoped-var": "error",
|
||||||
"comma-dangle": ["error", "always-multiline"],
|
|
||||||
"complexity": ["error", {"max": 22}],
|
"complexity": ["error", {"max": 22}],
|
||||||
"indent-legacy": ["error", 2, {"SwitchCase": 1, "ArrayExpression": "first", "ObjectExpression": "first"}],
|
"indent-legacy": ["error", 2, {"SwitchCase": 1, "ArrayExpression": "first", "ObjectExpression": "first"}],
|
||||||
"max-nested-callbacks": ["error", 3],
|
"max-nested-callbacks": ["error", 3],
|
||||||
|
|
|
@ -21,7 +21,6 @@ module.exports = {
|
||||||
|
|
||||||
"array-bracket-spacing": ["error", "never"],
|
"array-bracket-spacing": ["error", "never"],
|
||||||
"block-scoped-var": "error",
|
"block-scoped-var": "error",
|
||||||
"comma-dangle": ["error", "always-multiline"],
|
|
||||||
complexity: ["error", {
|
complexity: ["error", {
|
||||||
max: 20,
|
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").
|
// since only let and const are used, see "no-var").
|
||||||
"block-scoped-var": "error",
|
"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.
|
// Warn about cyclomatic complexity in functions.
|
||||||
"complexity": ["error", {"max": 26}],
|
"complexity": ["error", {"max": 26}],
|
||||||
|
|
||||||
|
|
|
@ -238,9 +238,6 @@ module.exports = {
|
||||||
"brace-style": ["error", "1tbs", {"allowSingleLine": false}],
|
"brace-style": ["error", "1tbs", {"allowSingleLine": false}],
|
||||||
// Require camel case names
|
// Require camel case names
|
||||||
"camelcase": "error",
|
"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.
|
// Warn about cyclomatic complexity in functions.
|
||||||
"complexity": ["error", 53],
|
"complexity": ["error", 53],
|
||||||
// Don't warn for inconsistent naming when capturing this (not so important
|
// 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").
|
// since only let and const are used, see "no-var").
|
||||||
"block-scoped-var": "error",
|
"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.
|
// Warn about cyclomatic complexity in functions.
|
||||||
"complexity": "error",
|
"complexity": "error",
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ module.exports = {
|
||||||
"mozilla/var-only-at-top-level": "error",
|
"mozilla/var-only-at-top-level": "error",
|
||||||
"block-scoped-var": "error",
|
"block-scoped-var": "error",
|
||||||
"camelcase": "error",
|
"camelcase": "error",
|
||||||
"comma-dangle": "off",
|
|
||||||
"complexity": ["error", {"max": 20}],
|
"complexity": ["error", {"max": 20}],
|
||||||
"curly": "error",
|
"curly": "error",
|
||||||
"dot-location": ["error", "property"],
|
"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"],
|
"array-bracket-spacing": ["error", "never"],
|
||||||
"block-scoped-var": "error",
|
"block-scoped-var": "error",
|
||||||
"comma-dangle": ["error", "always-multiline"],
|
|
||||||
complexity: ["error", {
|
complexity: ["error", {
|
||||||
max: 23,
|
max: 23,
|
||||||
}],
|
}],
|
||||||
|
|
|
@ -16,7 +16,6 @@ module.exports = {
|
||||||
|
|
||||||
"rules": {
|
"rules": {
|
||||||
"camelcase": "error",
|
"camelcase": "error",
|
||||||
"comma-dangle": ["error", "never"],
|
|
||||||
"curly": ["error", "multi-line"],
|
"curly": ["error", "multi-line"],
|
||||||
"handle-callback-err": ["error", "er"],
|
"handle-callback-err": ["error", "er"],
|
||||||
"indent-legacy": ["error", 2, {"SwitchCase": 1}],
|
"indent-legacy": ["error", 2, {"SwitchCase": 1}],
|
||||||
|
|
|
@ -116,6 +116,9 @@ module.exports = {
|
||||||
// No newline before open brace for a block
|
// No newline before open brace for a block
|
||||||
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
|
"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
|
// No space before always a space after a comma
|
||||||
"comma-spacing": ["error", {"after": true, "before": false}],
|
"comma-spacing": ["error", {"after": true, "before": false}],
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "eslint-plugin-mozilla",
|
"name": "eslint-plugin-mozilla",
|
||||||
"version": "0.15.1",
|
"version": "0.15.3",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "eslint-plugin-mozilla",
|
"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.",
|
"description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"eslint",
|
"eslint",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче