Skip to content

Commit 30228a2

Browse files
committed
Add doc about lint ignore
1 parent 06b263f commit 30228a2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,29 @@ You can also configure `lint-staged` as a pre-commit hook by running the followi
4040
$ pnpm configure-hooks
4141
```
4242

43+
### Ignore code
44+
45+
If you want to ignore a lint rule for a specific line of the code, you can add a suppression comment above the line that emits the lint diagnostic:
46+
47+
```ts
48+
// biome-ignore <rule>: <optional-explanation>
49+
```
50+
51+
For example:
52+
53+
```ts
54+
// biome-ignore lint/suspicious/noNamespace:
55+
namespace foo {}
56+
```
57+
58+
For `useExhaustiveDependencies` (equivalent of `react-hooks/exhaustive-deps`), you can even specify which dependencies are ignored:
59+
60+
```ts
61+
// biome-ignore lint/correctness/useExhaustiveDependencies(fn):
62+
// biome-ignore lint/correctness/useExhaustiveDependencies(value):
63+
useEffect(fn, [fn, value]);
64+
```
65+
4366
## Generate Fluent icons
4467

4568
Add the name of the desired icon in `scripts/fluent-icons/icons.json` using the format `icon-name-{filled|regular}`, and run the following command:

0 commit comments

Comments
 (0)