simple regex matching biome linter #661
-
|
struggling to implement a simple regex matching linter for biome. the goal is to ban custom tailwind colors like export function StyledHeader({ title }: StyledHeaderProps) {
const tailwindClass = "text-[#FF0000]" // < expecting to highlight this
return <h1 className={"text-5xl text-[#FF0000]"}>{title}</h1> // < and this
}the regex pattern is known to work via regex101.com, but for some reason when i try running i can get it to work when capturing does anyone happen to have an example of a very simple regex matching grit file for biome linter? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Beta Was this translation helpful? Give feedback.
-
|
i think the reason why i'm getting multiple hits is because it's capturing multiple parts of the AST tree, ie
i also tried binding to a JS string literal but that didn't work |
Beta Was this translation helpful? Give feedback.
-
|
You could try using an AST node: |
Beta Was this translation helpful? Give feedback.


was able to get our lint checks down from 17s to 1.2s by using
jsx_attributeas found here