mozilla/testpilot

Refine .eslintrc rules for node vs browser JS

Offen

#3.228 geöffnet am 10.01.2018

 (6 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)FreeMarker (108 Forks)auto 404
dev papercutgood first issueskill:js

Repository-Metriken

Stars
 (250 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

As @pdehaan mentions:

What about just specifying the ESLint environment in the gulpfile.babel.js and webpack.config.js, a la /* eslint-env node, browser, whatever */. Or if we want to set the node env for a directory, we could just use a nested .eslintrc file (for tests or gulp tasks or whatnot).

We've got a pretty broad set of globals and envs covering all of our JS for linting, right now. But, some JS is for the build chain in node and some are for running in the browser. Might be nice to use per-directory & file glob eslint overrides to further focus what's allowed for various source files.

Contributor Guide