Skip to content

Commit

Permalink
Bug 1434449 - Enable no-unused-vars for the global (as well as local)…
Browse files Browse the repository at this point in the history
… scope on jsm files, whitelist directories still to be fixed. r=florian.

MozReview-Commit-ID: 3vBWDR3UjGF

--HG--
extra : rebase_source : 61495d14a8d761e71b4072b02e2ca57e77f44059
  • Loading branch information
Standard8 committed Jan 30, 2018
1 parent b9f306b commit 9a21725
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
18 changes: 18 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,23 @@ module.exports = {
"rules": {
"mozilla/use-services": "off",
}
}, {
// XXX Bug 1434446. These directories have jsm files still being fixed, so
// turn off global no-unused-vars checking for them.
"files": [
"accessible/**/*.jsm",
"browser/components/**/*.jsm",
"browser/extensions/**/*.jsm",
"services/sync/**/*.jsm",
"toolkit/**/*.jsm",
],
"rules": {
"mozilla/mark-exported-symbols-as-used": "error",
"no-unused-vars": ["error", {
"args": "none",
"vars": "local",
"varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS"
}]
}
}]
};
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ module.exports = {
},
"files": "**/*.jsm",
"rules": {
"mozilla/mark-exported-symbols-as-used": "error"
// "no-unused-vars": ["error", {
// "args": "none",
// "vars": "all",
// "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS"
// }]
"mozilla/mark-exported-symbols-as-used": "error",
"no-unused-vars": ["error", {
"args": "none",
"vars": "all",
"varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS"
}]
}
}],

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.6.0",
"version": "0.7.0",
"description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.",
"keywords": [
"eslint",
Expand Down

0 comments on commit 9a21725

Please sign in to comment.