From 51587bca2f844eac3f57da3743e86daeac064ae4 Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Thu, 19 Jun 2025 15:08:24 +0200 Subject: [PATCH 1/9] biome: run from parent --- linters/biome/plugin.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linters/biome/plugin.yaml b/linters/biome/plugin.yaml index 4176814b5..0597ec0ab 100644 --- a/linters/biome/plugin.yaml +++ b/linters/biome/plugin.yaml @@ -15,8 +15,10 @@ lint: - astro - css - graphql + - html - javascript - json + - sass - typescript description: A static analyzer for web projects commands: @@ -26,6 +28,7 @@ lint: ' *(?P.*?):(?P\d+):(?P\d+) (?P[^ ]+)(?:[^×]*\n).*× (?P.*)\n' run: biome check ${target} + run_from: ${parent} success_codes: [0, 1] batch: true cache_results: true @@ -33,6 +36,7 @@ lint: - name: fmt output: rewrite run: biome check --fix "${target}" + run_from: ${parent} success_codes: [0, 1] batch: true cache_results: true From d6ae6cf1a63007044e89b1cc5f0026b5c101037c Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Thu, 19 Jun 2025 22:34:28 +0200 Subject: [PATCH 2/9] No SCSS yet --- linters/biome/plugin.yaml | 1 - package.json | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/linters/biome/plugin.yaml b/linters/biome/plugin.yaml index 0597ec0ab..4f4b351b6 100644 --- a/linters/biome/plugin.yaml +++ b/linters/biome/plugin.yaml @@ -18,7 +18,6 @@ lint: - html - javascript - json - - sass - typescript description: A static analyzer for web projects commands: diff --git a/package.json b/package.json index 49d1dff31..4e2ee3ee0 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "bundleDependencies": [ "tests" ], + "packageManager": "pnpm@10.12.1+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac", "engines": { "node": ">=22" } From 2c1fccd623eb9d70c01476ec31420c3b5127764d Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Wed, 25 Jun 2025 07:41:39 +0200 Subject: [PATCH 3/9] run_from: ${root_or_parent_with_any_config} --- linters/biome/plugin.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linters/biome/plugin.yaml b/linters/biome/plugin.yaml index 4f4b351b6..ca86cef8d 100644 --- a/linters/biome/plugin.yaml +++ b/linters/biome/plugin.yaml @@ -27,7 +27,7 @@ lint: ' *(?P.*?):(?P\d+):(?P\d+) (?P[^ ]+)(?:[^×]*\n).*× (?P.*)\n' run: biome check ${target} - run_from: ${parent} + run_from: ${root_or_parent_with_any_config} success_codes: [0, 1] batch: true cache_results: true @@ -35,7 +35,7 @@ lint: - name: fmt output: rewrite run: biome check --fix "${target}" - run_from: ${parent} + run_from: ${root_or_parent_with_any_config} success_codes: [0, 1] batch: true cache_results: true From b6861d23542b86c261002339a1e390bd8875f837 Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Wed, 25 Jun 2025 07:43:52 +0200 Subject: [PATCH 4/9] Bump to 2.0.5 --- linters/biome/plugin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linters/biome/plugin.yaml b/linters/biome/plugin.yaml index ca86cef8d..65c723af7 100644 --- a/linters/biome/plugin.yaml +++ b/linters/biome/plugin.yaml @@ -6,7 +6,7 @@ tools: runtime: node package: "@biomejs/biome" shims: [biome] - known_good_version: 1.9.4 + known_good_version: 2.0.5 lint: definitions: # Successor to the rome linter+formatter From de4f91b52113a9977e8da351e5527f547a9f071a Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Wed, 25 Jun 2025 08:37:17 +0200 Subject: [PATCH 5/9] Fix tests for biome 2.0.5 --- linters/biome/plugin.yaml | 2 +- .../test_data/biome_v1.9.4_error.check.shot | 39 ------------------- ...ot => biome_v2.0.5_basic_check.check.shot} | 13 +------ ...t.shot => biome_v2.0.5_basic_fmt.fmt.shot} | 2 +- ....shot => biome_v2.0.5_basic_json.fmt.shot} | 0 package.json | 1 - 6 files changed, 3 insertions(+), 54 deletions(-) delete mode 100644 linters/biome/test_data/biome_v1.9.4_error.check.shot rename linters/biome/test_data/{biome_v1.9.4_basic_check.check.shot => biome_v2.0.5_basic_check.check.shot} (74%) rename linters/biome/test_data/{biome_v1.9.4_basic_fmt.fmt.shot => biome_v2.0.5_basic_fmt.fmt.shot} (96%) rename linters/biome/test_data/{biome_v1.9.4_basic_json.fmt.shot => biome_v2.0.5_basic_json.fmt.shot} (100%) diff --git a/linters/biome/plugin.yaml b/linters/biome/plugin.yaml index 65c723af7..fc429d389 100644 --- a/linters/biome/plugin.yaml +++ b/linters/biome/plugin.yaml @@ -50,7 +50,7 @@ lint: affects_cache: - package.json - .editorconfig # Undocumented config file - known_good_version: 1.9.4 + known_good_version: 2.0.5 version_command: parse_regex: biome CLI version ${semver} run: biome --version diff --git a/linters/biome/test_data/biome_v1.9.4_error.check.shot b/linters/biome/test_data/biome_v1.9.4_error.check.shot deleted file mode 100644 index e959c7ff4..000000000 --- a/linters/biome/test_data/biome_v1.9.4_error.check.shot +++ /dev/null @@ -1,39 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Testing linter biome test error 1`] = ` -{ - "issues": [], - "lintActions": [ - { - "command": "fmt", - "fileGroupName": "typescript", - "linter": "biome", - "paths": [ - "test_data/basic_check.in.ts", - ], - "verb": "TRUNK_VERB_FMT", - }, - { - "command": "lint", - "fileGroupName": "typescript", - "linter": "biome", - "paths": [ - "test_data/basic_check.in.ts", - ], - "verb": "TRUNK_VERB_CHECK", - }, - { - "command": "lint", - "fileGroupName": "typescript", - "linter": "biome", - "paths": [ - "test_data/basic_check.in.ts", - ], - "upstream": true, - "verb": "TRUNK_VERB_CHECK", - }, - ], - "taskFailures": [], - "unformattedFiles": [], -} -`; diff --git a/linters/biome/test_data/biome_v1.9.4_basic_check.check.shot b/linters/biome/test_data/biome_v2.0.5_basic_check.check.shot similarity index 74% rename from linters/biome/test_data/biome_v1.9.4_basic_check.check.shot rename to linters/biome/test_data/biome_v2.0.5_basic_check.check.shot index 4c68082f4..85dbb77b7 100644 --- a/linters/biome/test_data/biome_v1.9.4_basic_check.check.shot +++ b/linters/biome/test_data/biome_v2.0.5_basic_check.check.shot @@ -11,18 +11,7 @@ exports[`Testing linter biome test basic_check 1`] = ` "level": "LEVEL_HIGH", "line": "13", "linter": "biome", - "message": "This block statement doesn't serve any purpose and can be safely removed.", - "targetType": "typescript", - }, - { - "code": "lint/style/useEnumInitializers", - "column": "6", - "file": "test_data/basic_check.in.ts", - "issueClass": "ISSUE_CLASS_EXISTING", - "level": "LEVEL_HIGH", - "line": "4", - "linter": "biome", - "message": "This enum declaration contains members that are implicitly initialized.", + "message": "Formatter would have printed the following content:", "targetType": "typescript", }, ], diff --git a/linters/biome/test_data/biome_v1.9.4_basic_fmt.fmt.shot b/linters/biome/test_data/biome_v2.0.5_basic_fmt.fmt.shot similarity index 96% rename from linters/biome/test_data/biome_v1.9.4_basic_fmt.fmt.shot rename to linters/biome/test_data/biome_v2.0.5_basic_fmt.fmt.shot index 1e2f30ad4..30deff848 100644 --- a/linters/biome/test_data/biome_v1.9.4_basic_fmt.fmt.shot +++ b/linters/biome/test_data/biome_v2.0.5_basic_fmt.fmt.shot @@ -5,7 +5,7 @@ exports[`Testing formatter biome test basic_fmt 1`] = ` const barfoo = () => {}; enum Bar { - Baz = 0, + Baz, } const foo = (bar: Bar) => { diff --git a/linters/biome/test_data/biome_v1.9.4_basic_json.fmt.shot b/linters/biome/test_data/biome_v2.0.5_basic_json.fmt.shot similarity index 100% rename from linters/biome/test_data/biome_v1.9.4_basic_json.fmt.shot rename to linters/biome/test_data/biome_v2.0.5_basic_json.fmt.shot diff --git a/package.json b/package.json index 4e2ee3ee0..49d1dff31 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "bundleDependencies": [ "tests" ], - "packageManager": "pnpm@10.12.1+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac", "engines": { "node": ">=22" } From 0922bd29e86476fbfb0fd9960e0a7ee2c71a6a35 Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Sun, 29 Jun 2025 22:33:29 +0200 Subject: [PATCH 6/9] It must be parent --- linters/biome/plugin.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linters/biome/plugin.yaml b/linters/biome/plugin.yaml index fc429d389..3a25c9f67 100644 --- a/linters/biome/plugin.yaml +++ b/linters/biome/plugin.yaml @@ -27,7 +27,7 @@ lint: ' *(?P.*?):(?P\d+):(?P\d+) (?P[^ ]+)(?:[^×]*\n).*× (?P.*)\n' run: biome check ${target} - run_from: ${root_or_parent_with_any_config} + run_from: ${parent} success_codes: [0, 1] batch: true cache_results: true @@ -35,7 +35,7 @@ lint: - name: fmt output: rewrite run: biome check --fix "${target}" - run_from: ${root_or_parent_with_any_config} + run_from: ${parent} success_codes: [0, 1] batch: true cache_results: true From 379dfdf9f7a4ea4234f91f749d8a479432744ab0 Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Sat, 12 Jul 2025 23:04:37 +0200 Subject: [PATCH 7/9] run_from: ${target_directory} --- linters/biome/plugin.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linters/biome/plugin.yaml b/linters/biome/plugin.yaml index 3a25c9f67..5de63bb71 100644 --- a/linters/biome/plugin.yaml +++ b/linters/biome/plugin.yaml @@ -27,7 +27,7 @@ lint: ' *(?P.*?):(?P\d+):(?P\d+) (?P[^ ]+)(?:[^×]*\n).*× (?P.*)\n' run: biome check ${target} - run_from: ${parent} + run_from: ${target_directory} success_codes: [0, 1] batch: true cache_results: true @@ -35,7 +35,7 @@ lint: - name: fmt output: rewrite run: biome check --fix "${target}" - run_from: ${parent} + run_from: ${target_directory} success_codes: [0, 1] batch: true cache_results: true From 4090598d522e7333136cb0669ebb61834aeeda2f Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Sun, 13 Jul 2025 00:47:07 +0200 Subject: [PATCH 8/9] Run with --config-path --- linters/biome/plugin.yaml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/linters/biome/plugin.yaml b/linters/biome/plugin.yaml index 5de63bb71..44b99c1e1 100644 --- a/linters/biome/plugin.yaml +++ b/linters/biome/plugin.yaml @@ -26,27 +26,25 @@ lint: parse_regex: ' *(?P.*?):(?P\d+):(?P\d+) (?P[^ ]+)(?:[^×]*\n).*× (?P.*)\n' - run: biome check ${target} - run_from: ${target_directory} + run: biome check --config-path=${workspace}/biome.jsonc ${target} + run_from: ${root_or_parent_with(biome.jsonc)} success_codes: [0, 1] batch: true - cache_results: true + cache_results: false read_output_from: stderr - name: fmt output: rewrite - run: biome check --fix "${target}" - run_from: ${target_directory} - success_codes: [0, 1] + run: biome format --config-path=${workspace}/biome.jsonc --write ${target} + run_from: ${root_or_parent_with(biome.jsonc)} + success_codes: [0] batch: true - cache_results: true + cache_results: false formatter: true in_place: true tools: [biome] suggest_if: config_present direct_configs: - - biome.json - biome.jsonc - - rome.json # For backwards compatibility with rome affects_cache: - package.json - .editorconfig # Undocumented config file From b552dd2066e907d06418a0d14635f19fbf284f10 Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Sun, 13 Jul 2025 00:47:33 +0200 Subject: [PATCH 9/9] Formatted