Skip to content

Commit

Permalink
fix(biome): skip linting css/scss, and use --no-errors-on-unmatched
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Aug 13, 2024
1 parent 70a3dc7 commit dd7086f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cfg/biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"lineWidth": 100,
"attributePosition": "auto"
},
"organizeImports": { "enabled": true },
"organizeImports": { "enabled": false },
"linter": {
"enabled": true,
"rules": {
Expand Down
5 changes: 3 additions & 2 deletions cfg/lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/lint.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
)
}

Expand Down

0 comments on commit dd7086f

Please sign in to comment.