performance/useTopLevelRegex
performance · since 1.8.0
No autofix
biome.json
{
"linter": {
"rules": {
"performance": {
"useTopLevelRegex": "error"
}
}
}
}function foo(someString) {
return /[a-Z]*/.test(someString)
}const REGEX = /[a-Z]*/;
function foo(someString) {
return REGEX.test(someString)
}function foo(str) {
return /[a-Z]*/g.exec(str)
}Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
performance/useTopLevelRegex
performance · since 1.8.0
{
"linter": {
"rules": {
"performance": {
"useTopLevelRegex": "error"
}
}
}
}Enforce the sorting of Tailwind CSS classes.
Use static Response methods instead of new Response() constructor when possible.
Discard redundant terms from logical expressions.
Require one executable GraphQL definition per file.