@aliou/biome-plugins
v0.4.1
Published
Custom Biome lint rules written as GritQL plugins
Readme
biome-plugins
Custom Biome lint rules written as GritQL plugins.
Plugins
| Plugin | Description |
|---|---|
| no-inline-imports | Disallows await import() and require() inside functions. All imports should be static import statements at the top of the file. |
| no-interpolated-classname | Disallows template literals in className attributes. Enforces using a cn() utility instead. |
| phosphor-icon-suffix | Enforces that Phosphor icon imports end with the Icon suffix (e.g. HouseIcon, not House). |
| no-js-import-extension | Disallows .js extensions in import and re-export paths. Use moduleResolution: "bundler" in tsconfig.json instead. |
| no-emojis | Disallows emoji characters in string literals, template literals, and JSX text. |
| no-inner-types | Disallows TypeScript type and interface declarations inside function bodies. |
Usage
1. Install
npm install --save-dev @aliou/biome-pluginsOr with any other package manager:
pnpm add -D @aliou/biome-plugins
bun add -d @aliou/biome-plugins2. Configure
Reference the plugins you want in your biome.json using relative paths to node_modules:
{
"plugins": [
"./node_modules/@aliou/biome-plugins/plugins/no-interpolated-classname.grit",
"./node_modules/@aliou/biome-plugins/plugins/phosphor-icon-suffix.grit"
]
}Pick only the ones you need. Each plugin is a standalone .grit file.
3. Run
Plugin diagnostics show up when running biome lint or biome check as usual:
biome check .Limitations
Biome's plugin system is still experimental. There is no automatic npm package resolution for plugins -- you must use explicit relative paths to node_modules as shown above.
See biomejs/biome#6265 for the ongoing discussion on plugin distribution.
