Rule message substitution will get confused with triple braces #6988
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
bug
ESLint is working incorrectly
core
Relates to ESLint's core APIs and features
Currently, it is impossible to perform rule substitution for no-regex-spaces because the message displays a number in curly braces (representing a regex quantifier).
The correct message:
"Spaces are hard to count. Use {{{count}}}."
However, the regex for rule message substitution looks for
\{\{\s*(.+?)\s*\}\}
, which will result in the substitution code looking for a"{count}"
key.I'd like to replace
(.+?)
with([^}]+?)
. This will force the regex to match{{count}}
and extract"count"
as the key.The text was updated successfully, but these errors were encountered: