style/noTopLevelLiterals
style · since 2.4.7
No autofix
biome.json
{
"linter": {
"rules": {
"style": {
"noTopLevelLiterals": "error"
}
}
}
}"just a string"42true{
"property": "value",
"otherProperty": 123
}["element", "anotherElement"]{}Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
style/noTopLevelLiterals
style · since 2.4.7
{
"linter": {
"rules": {
"style": {
"noTopLevelLiterals": "error"
}
}
}
}Disallow constants whose string value is the same as their uppercase name.
Disallow template literals if interpolation and special-character handling are not needed
Disallow unused error parameters in catch clauses.
Checks if a default export exports the same symbol as a named export.