Environment information
CLI:
Version: 2.3.2
Color support: true
Platform:
CPU Architecture: x86_64
OS: linux
Environment:
BIOME_LOG_PATH: unset
BIOME_LOG_PREFIX_NAME: unset
BIOME_CONFIG_PATH: unset
BIOME_THREADS: unset
NO_COLOR: unset
TERM: xterm-256color
JS_RUNTIME_VERSION: v24.11.0
JS_RUNTIME_NAME: node
NODE_PACKAGE_MANAGER: pnpm/10.20.0
Biome Configuration:
Status: Loaded successfully
Path: biome.json
Formatter enabled: true
Linter enabled: true
Assist enabled: true
VCS enabled: true
Linter:
JavaScript enabled: unset
JSON enabled: unset
CSS enabled: unset
GraphQL enabled: unset
Recommended: true
Enabled rules:
a11y/noAccessKey
a11y/noAriaHiddenOnFocusable
a11y/noAriaUnsupportedElements
a11y/noAutofocus
a11y/noDistractingElements
a11y/noHeaderScope
a11y/noInteractiveElementToNoninteractiveRole
a11y/noLabelWithoutControl
a11y/noNoninteractiveElementToInteractiveRole
a11y/noNoninteractiveTabindex
a11y/noPositiveTabindex
a11y/noRedundantAlt
a11y/noRedundantRoles
a11y/noStaticElementInteractions
a11y/noSvgWithoutTitle
a11y/useAltText
a11y/useAnchorContent
a11y/useAriaActivedescendantWithTabindex
a11y/useAriaPropsForRole
a11y/useAriaPropsSupportedByRole
a11y/useButtonType
a11y/useFocusableInteractive
a11y/useGenericFontNames
a11y/useHeadingContent
a11y/useHtmlLang
a11y/useIframeTitle
a11y/useKeyWithClickEvents
a11y/useKeyWithMouseEvents
a11y/useMediaCaption
a11y/useSemanticElements
a11y/useValidAnchor
a11y/useValidAriaProps
a11y/useValidAriaRole
a11y/useValidAriaValues
a11y/useValidAutocomplete
a11y/useValidLang
complexity/noAdjacentSpacesInRegex
complexity/noArguments
complexity/noBannedTypes
complexity/noCommaOperator
complexity/noEmptyTypeParameters
complexity/noExtraBooleanCast
complexity/noFlatMapIdentity
complexity/noImportantStyles
complexity/noStaticOnlyClass
complexity/noThisInStatic
complexity/noUselessCatch
complexity/noUselessConstructor
complexity/noUselessContinue
complexity/noUselessEmptyExport
complexity/noUselessEscapeInRegex
complexity/noUselessFragments
complexity/noUselessLabel
complexity/noUselessLoneBlockStatements
complexity/noUselessRename
complexity/noUselessStringRaw
complexity/noUselessSwitchCase
complexity/noUselessTernary
complexity/noUselessThisAlias
complexity/noUselessTypeConstraint
complexity/noUselessUndefinedInitialization
complexity/useArrowFunction
complexity/useDateNow
complexity/useFlatMap
complexity/useIndexOf
complexity/useLiteralKeys
complexity/useNumericLiterals
complexity/useOptionalChain
complexity/useRegexLiterals
complexity/useSimpleNumberKeys
correctness/noConstAssign
correctness/noConstantCondition
correctness/noConstantMathMinMaxClamp
correctness/noConstructorReturn
correctness/noEmptyCharacterClassInRegex
correctness/noEmptyPattern
correctness/noGlobalObjectCalls
correctness/noInnerDeclarations
correctness/noInvalidBuiltinInstantiation
correctness/noInvalidConstructorSuper
correctness/noInvalidDirectionInLinearGradient
correctness/noInvalidGridAreas
correctness/noInvalidPositionAtImportRule
correctness/noInvalidUseBeforeDeclaration
correctness/noMissingVarFunction
correctness/noNonoctalDecimalEscape
correctness/noPrecisionLoss
correctness/noSelfAssign
correctness/noSetterReturn
correctness/noStringCaseMismatch
correctness/noSwitchDeclarations
correctness/noUnknownFunction
correctness/noUnknownMediaFeatureName
correctness/noUnknownProperty
correctness/noUnknownPseudoClass
correctness/noUnknownPseudoElement
correctness/noUnknownTypeSelector
correctness/noUnknownUnit
correctness/noUnmatchableAnbSelector
correctness/noUnreachable
correctness/noUnreachableSuper
correctness/noUnsafeFinally
correctness/noUnsafeOptionalChaining
correctness/noUnusedFunctionParameters
correctness/noUnusedImports
correctness/noUnusedLabels
correctness/noUnusedPrivateClassMembers
correctness/noUnusedVariables
correctness/noVoidElementsWithChildren
correctness/noVoidTypeReturn
correctness/useGraphqlNamedOperations
correctness/useIsNan
correctness/useParseIntRadix
correctness/useValidForDirection
correctness/useValidTypeof
correctness/useYield
performance/noAccumulatingSpread
performance/noDynamicNamespaceImportAccess
security/noBlankTarget
security/noGlobalEval
style/noDescendingSpecificity
style/noNonNullAssertion
style/useArrayLiterals
style/useConst
style/useDeprecatedReason
style/useExponentiationOperator
style/useExportType
style/useImportType
style/useLiteralEnumMembers
style/useNodejsImportProtocol
style/useShorthandFunctionType
style/useTemplate
suspicious/noApproximativeNumericConstant
suspicious/noAssignInExpressions
suspicious/noAsyncPromiseExecutor
suspicious/noBiomeFirstException
suspicious/noCatchAssign
suspicious/noClassAssign
suspicious/noCommentText
suspicious/noCompareNegZero
suspicious/noConfusingLabels
suspicious/noConfusingVoidType
suspicious/noConstEnum
suspicious/noControlCharactersInRegex
suspicious/noDebugger
suspicious/noDocumentCookie
suspicious/noDoubleEquals
suspicious/noDuplicateAtImportRules
suspicious/noDuplicateCase
suspicious/noDuplicateClassMembers
suspicious/noDuplicateCustomProperties
suspicious/noDuplicateElseIf
suspicious/noDuplicateFields
suspicious/noDuplicateFontNames
suspicious/noDuplicateJsxProps
suspicious/noDuplicateObjectKeys
suspicious/noDuplicateParameters
suspicious/noDuplicateProperties
suspicious/noDuplicateSelectorsKeyframeBlock
suspicious/noEmptyBlock
suspicious/noEmptyInterface
suspicious/noExplicitAny
suspicious/noExtraNonNullAssertion
suspicious/noFallthroughSwitchClause
suspicious/noFunctionAssign
suspicious/noGlobalAssign
suspicious/noGlobalIsFinite
suspicious/noGlobalIsNan
suspicious/noImplicitAnyLet
suspicious/noImportAssign
suspicious/noImportantInKeyframe
suspicious/noIrregularWhitespace
suspicious/noLabelVar
suspicious/noMisleadingCharacterClass
suspicious/noMisleadingInstantiator
suspicious/noMisrefactoredShorthandAssign
suspicious/noNonNullAssertedOptionalChain
suspicious/noOctalEscape
suspicious/noPrototypeBuiltins
suspicious/noQuickfixBiome
suspicious/noRedeclare
suspicious/noRedundantUseStrict
suspicious/noSelfCompare
suspicious/noShadowRestrictedNames
suspicious/noShorthandPropertyOverrides
suspicious/noSparseArray
suspicious/noSuspiciousSemicolonInJsx
suspicious/noTemplateCurlyInString
suspicious/noThenProperty
suspicious/noTsIgnore
suspicious/noUnknownAtRules
suspicious/noUnsafeDeclarationMerging
suspicious/noUnsafeNegation
suspicious/noUselessEscapeInString
suspicious/noUselessRegexBackrefs
suspicious/noWith
suspicious/useAdjacentOverloadSignatures
suspicious/useBiomeIgnoreFolder
suspicious/useDefaultSwitchClauseLast
suspicious/useGetterReturn
suspicious/useGoogleFontDisplay
suspicious/useIsArray
suspicious/useIterableCallbackReturn
suspicious/useNamespaceKeyword
Workspace:
Open Documents: 0
Rule name
Unknown
Playground link
https://github.com/klevercorrea/with-tailwindcss
Expected result
Bug Description
I was testing Biome v2.3's new full support for Astro and its integration with Tailwind CSS v4. To do this, I created a fresh project using the official Astro with-tailwindcss template:
pnpm create astro@latest -- --template with-tailwindcss
After setting up a basic Biome configuration on this new project, I discovered the following bug.
When running biome lint --write on an .astro file, a "safe fix" from an unknown lint rule incorrectly adds a newline inside the frontmatter block. This action is not idempotent, and subsequent runs add more newlines.
Crucially, running biome lint (without --write) on the same file reports no issues and suggests no fixes. This indicates a discrepancy where a fix is being applied by --write for an issue that isn't being detected by the linter on its own.
Steps to Reproduce
1. biome.json configuration:
{
"$schema": "https://biomejs.dev/schemas/2.3.2/schema.json",
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"html": {
"experimentalFullSupportEnabled": true
},
"overrides": [
{
"includes": [
"**/*.astro"
],
"linter": {
"rules": {
"correctness": {
"noUnusedVariables": "off",
"noUnusedImports": "off"
}
}
}
}
]
}
2. example.astro file:
---
const title = "Hello World";
---
<html>
<head>
<title>{title}</title>
</head>
<body>
<h1>{title}</h1>
</body>
</html>
3. Commands to run:
First, run the linter without the write flag.
# biome lint example.astro
Result: Observe that it reports no issues.
Next, run the linter with the --write flag.
# biome lint --write example.astro
Result: Observe that it reports that it fixed the file, and a newline is added to the frontmatter. Running it again adds another newline.
Actual Behavior
After running biome lint --write example.astro once, the file becomes:
---
const title = "Hello World";
---
<html>
<head>
<title>{title}</title>
</head>
<body>
<h1>{title}</h1>
</body>
</html>
After running it a second time, it becomes:
---
const title = "Hello World";
---
<html>
<head>
<title>{title}</title>
</head>
<body>
<h1>{title}</h1>
</body>
</html>
Code of Conduct
Environment information
Rule name
Unknown
Playground link
https://github.com/klevercorrea/with-tailwindcss
Expected result
Bug Description
I was testing Biome v2.3's new full support for Astro and its integration with Tailwind CSS v4. To do this, I created a fresh project using the official Astro
with-tailwindcsstemplate:After setting up a basic Biome configuration on this new project, I discovered the following bug.
When running
biome lint --writeon an.astrofile, a "safe fix" from an unknown lint rule incorrectly adds a newline inside the frontmatter block. This action is not idempotent, and subsequent runs add more newlines.Crucially, running
biome lint(without--write) on the same file reports no issues and suggests no fixes. This indicates a discrepancy where a fix is being applied by--writefor an issue that isn't being detected by the linter on its own.Steps to Reproduce
1.
biome.jsonconfiguration:{ "$schema": "https://biomejs.dev/schemas/2.3.2/schema.json", "linter": { "enabled": true, "rules": { "recommended": true } }, "html": { "experimentalFullSupportEnabled": true }, "overrides": [ { "includes": [ "**/*.astro" ], "linter": { "rules": { "correctness": { "noUnusedVariables": "off", "noUnusedImports": "off" } } } } ] }2.
example.astrofile:3. Commands to run:
First, run the linter without the write flag.
# biome lint example.astroNext, run the linter with the
--writeflag.# biome lint --write example.astroActual Behavior
After running
biome lint --write example.astroonce, the file becomes:After running it a second time, it becomes:
Code of Conduct