Files
react-native-devtools-frontend/scripts/eslint_rules
Nikolay Vitkov de07efad99 [eslint] Update lint to include .mjs files
EsLint support .mjs file by default now. But we exclude them from
running previously in our script.

Disabled the `es-modules-import` rule for our script folder
as it's not relevant there.

Added types comment to the EsLint rules.
This should make it easier to build and understand the current rules.

Bug: none
Change-Id: I448efdb055c9cc107e3bced9b3febe5eb226bcf6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6177719
Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2025-01-17 06:45:29 -08:00
..

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.