mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 08:35:26 +00:00
56d83fc4bd
While working on turning on no-undef I discovered that the various rules we have for defining globals are a little inconsistent in whether the files they load recurse through import-globals-from directives and none of them imported eslint globals directives. I think we're better off putting all this global parsing code in a single place rather than spread across multiple rules. Have one rule to turn it on for parsed files and one function to load globals from other files and make them share most of the code so we won't get inconsistent. If we find us needing to turn on/off individual features we can figure out a way to do that in the future. This patch does that, the globals.js file does all global parsing with a shared object that receives events from the AST, either through from an ESlint rule or from a simple AST walker using estraverse. MozReview-Commit-ID: 9KQZwsNNOUl --HG-- extra : rebase_source : 0f1cceca29ac398be97a55bbcd09fe58a8be1435 extra : source : 878db4caf845282f06542793bc4b5c24fa658c14
13 lines
202 B
Plaintext
13 lines
202 B
Plaintext
{
|
|
// When adding items to this file please check for effects on sub-directories.
|
|
"plugins": [
|
|
"mozilla"
|
|
],
|
|
"rules": {
|
|
"mozilla/import-globals": 1,
|
|
},
|
|
"env": {
|
|
"es6": true
|
|
},
|
|
}
|