Skip to content

Commit 851382f

Browse files
Squashed commit of the following:
commit fee944e Author: francoismassart <francois.massart@gmail.com> Date: Sun Apr 2 00:37:43 2023 +0200 docs: changelog commit b0567c0 Author: francoismassart <francois.massart@gmail.com> Date: Sun Apr 2 00:36:37 2023 +0200 3.10.2 commit 12730e1 Author: francoismassart <francois.massart@gmail.com> Date: Sun Apr 2 00:35:37 2023 +0200 fix: no-custom-classname doesn't work with hyphenated group names
1 parent 7e2ad3f commit 851382f

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ You can can the same information on your favorite command line software as well.
4040

4141
## Latest changelog
4242

43+
- fix: [`no-custom-classname` doesn't work with hyphenated group names](https://github.com/francoismassart/eslint-plugin-tailwindcss/issues/226)
4344
- fix: [default settings conflict](https://github.com/francoismassart/eslint-plugin-tailwindcss/issues/212)
4445
- fix: [`classRegex` ignored in vuejs](https://github.com/francoismassart/eslint-plugin-tailwindcss/issues/216)
4546
- chore: fix dependency vulnerability (mocha)

lib/rules/no-custom-classname.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const CUSTOM_CLASSNAME_DETECTED_MSG = `Classname '{{classname}}' is not a Tailwi
2626
// Group/peer names can be arbitrarily named and are not
2727
// generated by generateRules. Using a custom regexp to
2828
// validate these avoids false reports.
29-
const GROUP_NAME_REGEXP = /^(group|peer)\/[\w]+$/i;
29+
const GROUP_NAME_REGEXP = /^(group|peer)\/[\w\$\#\@\%\^\&\*\_\-]+$/i;
3030

3131
const contextFallbackCache = new WeakMap();
3232

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-tailwindcss",
3-
"version": "3.10.1",
3+
"version": "3.10.2",
44
"description": "Rules enforcing best practices while using Tailwind CSS",
55
"keywords": [
66
"eslint",

tests/lib/rules/no-custom-classname.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,13 @@ ruleTester.run("no-custom-classname", rule, {
878878
},
879879
{ code: `<div className="group/edit">Custom group name</div>` },
880880
{ code: `<div className="group-hover/edit:hidden">Custom group name variant</div>` },
881+
{
882+
code: `
883+
<div class="group/nav123$#@%^&*_-">
884+
<div class="group-hover/nav123$#@%^&*_-:h-0">group/nav123$#@%^&*_-</div>
885+
</div>
886+
`,
887+
},
881888
{
882889
code: `<div className="group-hover/edit:custom-class">Custom group name variant</div>`,
883890
options: [

0 commit comments

Comments
 (0)