Bug 1421968 - Enable ESLint rule mozilla/use-services by default, but whitelist it for various directories still to be fixed. r=mossop

MozReview-Commit-ID: KOZWr7FiDQZ

--HG--
extra : rebase_source : 92c9bc236c9043f6ce25cc2ba45264918eb2ac15
This commit is contained in:
Mark Banner 2017-11-28 19:24:12 +00:00
parent 41c7322062
commit 499ca20f31
7 changed files with 35 additions and 18 deletions

View file

@ -24,5 +24,27 @@ module.exports = {
"rules": {
"eol-last": "off",
}
}, {
// XXX Bug 1421969. These files/directories are still being fixed,
// so turn off mozilla/use-services for them for now.
"files": [
"accessible/**",
// Browser: Bug 1421379
"browser/extensions/shield-recipe-client/test/browser/head.js",
"browser/modules/offlineAppCache.jsm",
"chrome/**",
"devtools/**",
"dom/indexedDB/**",
"dom/media/**",
"extensions/pref/**",
"mobile/android/**",
"security/**",
"testing/**",
"tools/profiler/**",
"xpcom/**"
],
"rules": {
"mozilla/use-services": "off",
}
}]
};

View file

@ -5,7 +5,5 @@ module.exports = {
// XXX Bug 1326071 - This should be reduced down - probably to 20 or to
// be removed & synced with the mozilla/recommended value.
"complexity": ["error", 61],
"mozilla/use-services": "error",
}
};

View file

@ -6,7 +6,5 @@ module.exports = {
],
"rules": {
"no-throw-literal": 2,
"mozilla/use-services": "error",
},
}

View file

@ -7,16 +7,5 @@ module.exports = {
"complexity": ["error", 41],
"mozilla/no-task": "error",
"mozilla/use-services": "error",
},
"overrides": [{
// Turn off use-services for xml files. XBL bindings are going away, and
// working out the valid globals for those is difficult.
"files": "**/*.xml",
"rules": {
"mozilla/use-services": "off",
}
}]
}
};

View file

@ -56,6 +56,15 @@ module.exports = {
"uneval": false
},
"overrides": [{
// Turn off use-services for xml files. XBL bindings are going away, and
// working out the valid globals for those is difficult.
"files": "**/*.xml",
"rules": {
"mozilla/use-services": "off"
}
}],
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
@ -148,6 +157,7 @@ module.exports = {
"mozilla/no-useless-removeEventListener": "error",
"mozilla/use-default-preference-values": "error",
"mozilla/use-ownerGlobal": "error",
"mozilla/use-services": "error",
// Always require parenthesis for new calls
// "new-parens": "error",

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "eslint-plugin-mozilla",
"version": "0.4.9",
"version": "0.4.10",
"description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.",
"keywords": [
"eslint",