biome
biome copied to clipboard
💅 `lint/complexity/useLiteralKeys` suggests incorrect fix
Environment information
CLI:
Version: 1.7.1
Color support: true
Platform:
CPU Architecture: aarch64
OS: macos
Environment:
BIOME_LOG_DIR: unset
NO_COLOR: unset
TERM: "xterm-256color"
JS_RUNTIME_VERSION: "v20.11.1"
JS_RUNTIME_NAME: "node"
NODE_PACKAGE_MANAGER: "pnpm/8.6.12"
Biome Configuration:
Status: Loaded successfully
Formatter disabled: false
Linter disabled: false
Organize imports disabled: false
VCS disabled: true
Linter:
Recommended: false
All: false
Rules: complexity/noBannedTypes = "error"
complexity/noUselessTypeConstraint = "error"
complexity/useLiteralKeys = "error"
complexity/useOptionalChain = "error"
correctness/noPrecisionLoss = "error"
correctness/noUnusedVariables = "error"
style/noInferrableTypes = "error"
style/noNamespace = "error"
style/useAsConstAssertion = "error"
style/useBlockStatements = "off"
style/useConsistentArrayType = "error"
style/useConst = "off"
style/useForOf = "error"
style/useShorthandFunctionType = "error"
suspicious/noEmptyBlockStatements = "off"
suspicious/noExplicitAny = "off"
suspicious/noExtraNonNullAssertion = "error"
suspicious/noMisleadingInstantiator = "error"
suspicious/noUnsafeDeclarationMerging = "error"
suspicious/useAwait = "off"
suspicious/useNamespaceKeyword = "error"
Workspace:
Open Documents: 0
Rule name
lint/complexity/useLiteralKeys
Playground link
https://biomejs.dev/playground/?lintRules=all&code=ZgBsAGEAZwBzAFsAJwBfACcAXQBbADAAXQA7AA%3D%3D
Expected result
It should suggest
flags._.[0]
Instead of
flags._[0]
Code of Conduct
- [X] I agree to follow Biome's Code of Conduct
It should suggest
flags._.[0]
Are you sure about this? This looks like an invalid syntax as reported by the TypeScript playground. The suggested fix seems correct to me.