From dd7086f3dd2d71c10c00a742a3d45ce246c4a3d9 Mon Sep 17 00:00:00 2001 From: kirillgroshkov Date: Tue, 13 Aug 2024 14:17:12 +0200 Subject: [PATCH] fix(biome): skip linting css/scss, and use --no-errors-on-unmatched --- cfg/biome.jsonc | 2 +- cfg/lint-staged.config.js | 5 +++-- src/lint.util.ts | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cfg/biome.jsonc b/cfg/biome.jsonc index 1b592ea..e3f2f81 100644 --- a/cfg/biome.jsonc +++ b/cfg/biome.jsonc @@ -12,7 +12,7 @@ "lineWidth": 100, "attributePosition": "auto" }, - "organizeImports": { "enabled": true }, + "organizeImports": { "enabled": false }, "linter": { "enabled": true, "rules": { diff --git a/cfg/lint-staged.config.js b/cfg/lint-staged.config.js index 48b9d54..7bbecba 100644 --- a/cfg/lint-staged.config.js +++ b/cfg/lint-staged.config.js @@ -44,7 +44,7 @@ const stylelintCmd = stylelintExists ? `stylelint --fix --config ${stylelintConf // const biomeInstalled = fs.existsSync('node_modules/@biomejs/biome') const biomeConfigPath = ['biome.jsonc'].find(p => fs.existsSync(p)) -const biomeCmd = biomeConfigPath && `biome lint --write --unsafe --` +const biomeCmd = biomeConfigPath && `biome lint --write --unsafe --no-errors-on-unmatched` if (!eslintConfigPathRoot) { console.log('eslint is skipped, because ./eslint.config.js is not present') @@ -94,7 +94,8 @@ const linters = { [`./{${prettierDirs}}/**/*.{${stylelintExtensions}}`]: match => { const filesList = getFilesList(match) if (!filesList) return [] - return [biomeCmd, stylelintCmd, prettierCmd].filter(Boolean).map(s => `${s} ${filesList}`) + // Biome's css/scss support is still in nursery, so Biome is disabled for now + return [stylelintCmd, prettierCmd].filter(Boolean).map(s => `${s} ${filesList}`) }, // Files in root dir: prettier diff --git a/src/lint.util.ts b/src/lint.util.ts index bab9863..00a1aa3 100644 --- a/src/lint.util.ts +++ b/src/lint.util.ts @@ -325,7 +325,9 @@ export function runBiome(fix = true): void { execVoidCommandSync( `biome`, - [`lint`, fix && '--write', fix && '--unsafe', ...dirs].filter(_isTruthy), + [`lint`, fix && '--write', fix && '--unsafe', '--no-errors-on-unmatched', ...dirs].filter( + _isTruthy, + ), ) }