biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
15.6k stars 486 forks source link

🐛 useNamingConvention matcher does not accept \$ #4613

Closed edfenergy-SteveD closed 1 week ago

edfenergy-SteveD commented 1 week ago

Environment information

Biome 1.9.4

What happened?

I'm trying to implement a matcher in useNamingConvention to align to an object member that begins with a dollar sign, using the regex \$(.+), however it's not accepting the escaped $.

Can support for this be included in a future build please? We've got a number of api calls that use this format in our project and, at the moment, they're littered with biome-ignores.

Expected result

\$(.+) is an acceptable matcher

Code of Conduct

ematipico commented 1 week ago

This doesn't seem a bug but a feature request?

Conaclos commented 1 week ago

I'm trying to implement a matcher in useNamingConvention to align to an object member that begins with a dollar sign, using the regex \$(.+), however it's not accepting the escaped $.

I guess it is in the Biome JSON config file? In that case you have to double escape \: \\$(.+). You can also write [$](.+)

edfenergy-SteveD commented 1 week ago

@Conaclos - oh for goodness' sake, that was it. Thank you!