This repository contains a minimal reproduction of a bug in Biome where CSS linting ignores are not respected in CLI commands, despite working correctly in the IDE.
This is a simple node project with the following key parts:
src/style.css- Contains CSS with both regular linting errors and ignored errorsbiome.json- Local configuration that extends a global organization-wide configbase-config/- Contains the organization's base Biome configurationbase-config/plugins/- Custom Biome plugins used across projects
Our Biome configuration is designed to work across multiple projects in the organization:
-
The local
biome.jsonextends a base configuration:{ "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", "extends": ["./base-config/biome.json"] } -
The
base-config/biome.jsoncontains organization-wide rules and settings -
Custom plugins (like the
noManualZIndexrule) are defined in thebase-config/plugins/directory
When using the biome-ignore comment directive in a CSS file, the directive works correctly in JetBrains IDE, but the CLI commands ignore the directive and still report the error.
Related GitHub links:
- Original Discussion: biomejs/biome#5854
- Bug Report: biomejs/biome#6031
-
Clone this repository
-
Install dependencies with
npm install -
Examine the
src/style.cssfile - note there are two CSS rules:- One without an ignore directive (should be reported)
- One with an ignore directive (should be ignored)
-
Run the linting command to see the incorrect behavior:
npm run lintNote that both errors are reported, even the one with the ignore directive
-
Similarly, you can run the format command:
npm run formatAnd observe that the ignore directive is not respected
-
OPTIONAL - Open the project in a JetBrains IDE with the biome plugin installed and configured to see the correct behaviour - only the non-ignored error is highlighted
- Expected: Both the IDE and CLI should respect the
biome-ignoredirective and not report the ignored error - Actual: The JetBrains IDE correctly respects the ignore directive, but the CLI commands (
npm run lintandnpm run format) report errors that should be ignored
- Biome version: 2.0.0-beta.4
- IDE: JetBrains IDE
- Operating System: MacOS