@moderneinc/biome-plugins 6.1.0-alpha.f3c8fa → 7.0.0-next.4ff15f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +40 -11
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -24,24 +24,53 @@ Install the package:
24
24
  npm install --save-dev @moderneinc/biome-plugins
25
25
  ```
26
26
 
27
- Add the plugin paths to your `biome.json`:
27
+ Add the plugin paths to your `biome.json`. These rules are about how *source* is
28
+ written, so scope them away from your tests — see [Scoping](#scoping) below:
28
29
 
29
30
  ```json
30
31
  {
31
- "plugins": [
32
- "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-colors.grit",
33
- "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-font-sizes.grit",
34
- "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-font-weights.grit",
35
- "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-spacing.grit",
36
- "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-shadows.grit",
37
- "./node_modules/@moderneinc/biome-plugins/plugins/no-pxToRem-non-font.grit",
38
- "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-border-radius.grit",
39
- "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-mui-classes.grit",
40
- "./node_modules/@moderneinc/biome-plugins/plugins/no-css-variables.grit"
32
+ "overrides": [
33
+ {
34
+ "includes": ["**", "!**/tests/**"],
35
+ "plugins": [
36
+ "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-colors.grit",
37
+ "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-font-sizes.grit",
38
+ "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-font-weights.grit",
39
+ "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-spacing.grit",
40
+ "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-shadows.grit",
41
+ "./node_modules/@moderneinc/biome-plugins/plugins/no-pxToRem-non-font.grit",
42
+ "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-border-radius.grit",
43
+ "./node_modules/@moderneinc/biome-plugins/plugins/no-hardcoded-mui-classes.grit",
44
+ "./node_modules/@moderneinc/biome-plugins/plugins/no-css-variables.grit"
45
+ ]
46
+ }
41
47
  ]
42
48
  }
43
49
  ```
44
50
 
51
+ ## Scoping
52
+
53
+ A test asserting what a token resolves to has to spell the literal out, so
54
+ pointing these rules at a test suite turns every such assertion into an error.
55
+ Scoping the plugin list, as above, is what exempts them.
56
+
57
+ Keep the leading `"**"`. `includes` is an allowlist, so `["!**/tests/**"]` alone
58
+ matches nothing and silently disables every plugin in the list.
59
+
60
+ Per-plugin scoping works too on Biome 2.5+, if you want different globs per rule
61
+ (earlier versions reject `path` as an unknown key):
62
+
63
+ ```json
64
+ { "plugins": [{ "path": "./…/no-hardcoded-colors.grit", "includes": ["**", "!**/tests/**"] }] }
65
+ ```
66
+
67
+ What does *not* work is subtracting in an override: `overrides[].plugins` adds to
68
+ the top-level list rather than replacing it, so there is no way to switch a
69
+ plugin off for a path once it is declared at the top level. For a one-off escape,
70
+ `// biome-ignore lint/plugin: reason` suppresses at a single site — note the
71
+ selector is `lint/plugin`, not the `plugin` category the diagnostic reports, and
72
+ it silences every plugin there rather than one.
73
+
45
74
  ## Requirements
46
75
 
47
76
  - [Biome](https://biomejs.dev/) v2.0+ with GritQL plugin support
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moderneinc/biome-plugins",
3
- "version": "6.1.0-alpha.f3c8fa",
3
+ "version": "7.0.0-next.4ff15f",
4
4
  "description": "Biome GritQL lint plugins for Moderne design token enforcement",
5
5
  "type": "module",
6
6
  "files": [