Custom Biome lint rules written as GritQL plugins
55%
TypeScript 29%
Shell 16%
Nix <1%

README.md

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-ts-import-extension Disallows .ts 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.
pi-no-node-exec Disallows importing from child_process / node:child_process in pi extensions. Use pi.exec() from the ExtensionAPI instead.
no-buried-await Disallows burying await inside parentheses or call arguments. Await the value first, then use it in a separate expression.
no-empty-catch Disallows empty catch blocks. Catch blocks must contain actual code, not only comments.
no-is-record Disallows creating isRecord function helpers. Use explicit types or schema-specific validation instead.
no-unimported-text Requires Text references, including type annotations, new Text(), and <Text>, to have a runtime import binding. Prevents accidental use of the DOM Text global.

Usage #

1. Install #

npm install --save-dev @aliou/biome-plugins

Or with any other package manager:

pnpm add -D @aliou/biome-plugins
bun add -d @aliou/biome-plugins

2. 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.