Describe the bug
It is a common mistake among Japanese developers to mistakenly insert an Ideographic Space (U+3000) in place of a normal space character (U+0020).
Example:
<div className="px-1 py-2">notice that the space between px-1 and py-2 is a U+3000</div>
According to the relevant spec, px-1[U+3000]py-2 is treated as one class name, not two separated by the space. Only ASCII whitespaces are treated as separators. Therefore, px-1[U+3000]py-2 is not recognized as a Tailwind class by browsers and it does not have any effect. I would like this plugin to catch this kind of mistake.
However, eslint-plugin-tailwindcss considers px-1[U+3000]py-2 as two classes (px-1 and py-2) so it cannot catch this mistake.
To Reproduce
Steps to reproduce the behavior:
- Enable the
no-custom-classname rule
- Run the rule against
<div className="px-1 py-2">notice that the space between px-1 and py-2 is a U+3000</div>
- Currently you get no error.
Expected behavior
The no-custom-classname rule should complain that px-1 py-2 is not a valid Tailwind classname.
Screenshots
Environment (please complete the following information):
- OS: macOS
- Softwares + version used:
Additional context
prettier-plugin-tailwindcss seems to have the same issue.
eslint config file or live demo
Describe the bug
It is a common mistake among Japanese developers to mistakenly insert an Ideographic Space (U+3000) in place of a normal space character (U+0020).
Example:
According to the relevant spec,
px-1[U+3000]py-2is treated as one class name, not two separated by the space. Only ASCII whitespaces are treated as separators. Therefore,px-1[U+3000]py-2is not recognized as a Tailwind class by browsers and it does not have any effect. I would like this plugin to catch this kind of mistake.However,
eslint-plugin-tailwindcssconsiderspx-1[U+3000]py-2as two classes (px-1andpy-2) so it cannot catch this mistake.To Reproduce
Steps to reproduce the behavior:
no-custom-classnamerule<div className="px-1 py-2">notice that the space between px-1 and py-2 is a U+3000</div>Expected behavior
The
no-custom-classnamerule should complain thatpx-1 py-2is not a valid Tailwind classname.Screenshots
Environment (please complete the following information):
[email protected][email protected]Additional context
prettier-plugin-tailwindcssseems to have the same issue.eslint config file or live demo