mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-02 18:11:04 +08:00
Accidentally importing something as `foo//bar.js` (rather than `foo/bar.js`) should not matter, and indeed both the TS build and ESBuild compile fine. However you get an error when running DevTools at runtime. What's unfortunate is that the error is very non obvious and it took me ages to realise that the root of it was an accidental `//`. This CL adds a check for this to the existing import rule and a test. Fixed: 346966388 Change-Id: I3922a58b89ce639fc619c0e2b83cd14f3fe993cb Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6157259 Commit-Queue: Andres Olivares <andoli@chromium.org> Auto-Submit: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Andres Olivares <andoli@chromium.org>
Custom ESLint rules for Chromium DevTools
The lib/ folder contains a set of ESLint rules
specific to Chromium DevTools. These rules are executed as part of the
npm run lint
command and implicitly via the Presubmit checks.
We follow the ESLint Rule Naming Conventions
and consistently use dashes to separate words (instead of underscores), and prefix
all rules that disallow something with no-.
Testing the rules
When writing a custom ESLint rule, place the logic into a file lib/foo.js and
add a corresponding test for the logic to tests/foo.test.js.
You can use
npm run eslint-test
to run the tests for the custom ESLint rules.