Open Bug 1812547 Opened 2 years ago Updated 2 years ago

devtools eslintrc says `require` is available everywhere but that isn't true for tests under that config which confuses eslint

Categories

(Developer Infrastructure :: Lint and Formatting, defect, P5)

Desktop
All

Tracking

(Not tracked)

People

(Reporter: Gijs, Unassigned)

References

(Depends on 1 open bug)

Details

I noticed this in working on https://phabricator.services.mozilla.com/D166177 and Mark correctly asked me to file a followup bug to fix it "properly". I'm not quite sure what that'd look like because I don't fully understand which devtools files will have require available and which won't.

Can you please detail a little bit the specificity of the issue here?

Flags: needinfo?(gijskruitbosch+bugs)

devtools' ESLint configuration indicates that loader and require are available everywhere in devtools, when they are not.

The no-redeclare-with-import-autofix rule that Gijs added in bug 1795255 had to have exclusions so that it would not complain about loader and require.

I think ideally, we would scope those variables to only the files where they are definitely globals, however that looks a little complex as there's a lot of files. Use of import-globals-from instead might be possible, but again, there's a lot of files here to be concerned about.

It might also be easier to wait until bug 1525652 is completed, and then clean this up at that time.

At the moment, I don't think this is a high priority. The current situation is not too bad, though we should tidy it up when we can.

Severity: -- → S4
Depends on: 1525652
Flags: needinfo?(gijskruitbosch+bugs)
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.