зеркало из 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": {
|
||||
"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",
|
||||
|
|
Загрузка…
Ссылка в новой задаче