-
-
Notifications
You must be signed in to change notification settings - Fork 208
docs: add plugin file scoping (includes) documentation #3993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from 2 commits
173a17c
1c143b8
bac5488
cebc481
e7d30a2
fc139c7
8a84be7
dab73f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,34 @@ the following configuration: | |
| ``` | ||
|
|
||
| The plugin will now be enabled on all supported files the linter runs on. You | ||
| can see its results when running `biome lint` or `biome check`. For example: | ||
| can see its results when running `biome lint` or `biome check`. | ||
|
|
||
| ### File Scoping | ||
|
|
||
| By default, a plugin runs on every file the linter processes. If a plugin only | ||
| applies to certain files, you can restrict it using `includes` glob patterns. | ||
| Use negated globs (prefixed with `!`) for exclusions: | ||
|
||
|
|
||
| ```json name="biome.json" | ||
| { | ||
| "plugins": [ | ||
| { | ||
| "path": "./react-plugin.grit", | ||
| "includes": ["src/components/**"] | ||
| }, | ||
| { | ||
| "path": "./ts-only-plugin.grit", | ||
| "includes": ["src/**/*.ts", "!**/*.test.ts"] | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| When `includes` is set, the plugin only runs on files matching at least one of | ||
| the patterns. Negated patterns act as exceptions, following the same semantics | ||
| as [`.gitignore`](https://git-scm.com/docs/gitignore#_pattern_format). | ||
chocky335 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| For example: | ||
|
|
||
| ```shell | ||
| $ biome lint | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.