Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1421968 - Enable ESLint rule mozilla/use-services by default, but…
Browse files Browse the repository at this point in the history
… whitelist it for various directories still to be fixed. r=mossop

MozReview-Commit-ID: KOZWr7FiDQZ
  • Loading branch information
Standard8 committed Nov 28, 2017
1 parent a50b866 commit aebc9ad
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 18 deletions.
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
}]
};
2 changes: 0 additions & 2 deletions browser/components/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
};
2 changes: 0 additions & 2 deletions services/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ module.exports = {
],
"rules": {
"no-throw-literal": 2,

"mozilla/use-services": "error",
},
}
13 changes: 1 addition & 12 deletions toolkit/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
}]
}
};
10 changes: 10 additions & 0 deletions tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tools/lint/eslint/eslint-plugin-mozilla/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/lint/eslint/eslint-plugin-mozilla/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit aebc9ad

Please sign in to comment.