Skip to content

Commit 1a98fc8

Browse files
authored
feat(build-tools): Add Biome 2.x config reader with version auto-detection (#25969)
Adds Biome 2.x configuration reader for fluid-build with automatic version detection. Biome 2.x changed from separate `include`/`ignore` fields to a unified `includes` field with negation patterns. ## Key Changes **New modules:** - `biome2Config.ts` - Biome 2.x config reader with unified `includes` field and re-inclusion pattern support - `biome2ConfigTypes.d.ts` - Auto-generated types from Biome 2.x JSON schema - `biomeVersion.ts` - Version detection from package.json or CLI - `biomeConfigUtils.ts` - Shared utilities (config loading, extends resolution, factory, interface) **Refactored:** - `biomeConfig.ts` - Renamed to `BiomeConfigReaderV1` for v1-specific implementation - `biomeTasks.ts` - Uses `createBiomeConfigReader()` factory for auto-detection ## Features - Auto-detects Biome version and returns appropriate reader (v1 or v2) - Supports `root` field for automatic parent config discovery - Handles both explicit `extends` and implicit parent config merging - Supports `//` microsyntax for extending root config - Comprehensive test coverage for v2 config scenarios
1 parent 620f26a commit 1a98fc8

File tree

44 files changed

+8635
-41
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+8635
-41
lines changed

biome.jsonc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444

4545
// Test json
4646
"build-tools/packages/build-tools/src/test/data/biome/empty.jsonc",
47+
// Biome 2.x test data - these configs use Biome 2.x syntax that Biome 1.x can't parse
48+
"build-tools/packages/build-tools/src/test/data/biome2/**",
4749
"experimental/dds/tree/src/test/documents/**",
4850
"packages/dds/map/src/test/mocha/snapshots/**/*.json",
4951
"packages/dds/matrix/src/test/results/**/*.json",

build-tools/biome.jsonc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"enabled": true
99
},
1010
"files": {
11-
"ignore": ["packages/build-tools/src/test/data/biome/empty.jsonc"]
11+
"ignore": [
12+
"packages/build-tools/src/test/data/biome/empty.jsonc",
13+
"packages/build-tools/src/test/data/biome2/**"
14+
]
1215
}
1316
}

build-tools/packages/build-tools/biome.jsonc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
33
"extends": ["../../../biome.jsonc"],
44
"files": {
5-
"ignore": ["src/test/data/biome/empty.jsonc"]
5+
"ignore": [
6+
"src/test/data/biome/empty.jsonc",
7+
// Biome 2.x test data - these configs use Biome 2.x syntax that Biome 1.x can't parse
8+
"src/test/data/biome2/**"
9+
]
610
}
711
}

build-tools/packages/build-tools/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
3131
"format": "npm run format:biome",
3232
"format:biome": "biome check --write .",
33+
"json-schema-to-typescript:biome2ConfigTypes": "json2ts --input node_modules/@biomejs/biome/configuration_schema.json --output src/common/biome2ConfigTypes.d.ts",
3334
"json-schema-to-typescript:biomeConfigTypes": "json2ts --input node_modules/@biomejs/biome/configuration_schema.json --output src/common/biomeConfigTypes.d.ts",
3435
"lint": "npm run eslint",
3536
"lint:fix": "npm run eslint:fix",

0 commit comments

Comments
 (0)