eslint-plugin-tailwindcss
Advanced tools
Comparing version 3.12.0 to 3.12.1-beta.0
@@ -17,2 +17,3 @@ /** | ||
const generated = require('../util/generated'); | ||
const escapeRegex = require('../util/regex').escapeRegex; | ||
@@ -30,3 +31,4 @@ //------------------------------------------------------------------------------ | ||
// validate these avoids false reports. | ||
const GROUP_NAME_REGEXP = /^(group|peer)\/[\w\$\#\@\%\^\&\*\_\-]+$/i; | ||
const getGroupNameRegex = (prefix = '') => | ||
new RegExp(`^${escapeRegex(prefix)}(group|peer)\/[\\w\\$\\#\\@\\%\\^\\&\\*\\_\\-]+$`, 'i'); | ||
@@ -115,2 +117,3 @@ const contextFallbackCache = new WeakMap(); | ||
const classnamesFromFiles = getClassnamesFromCSS(cssFiles, cssFilesRefreshRate); | ||
const groupNameRegex = getGroupNameRegex(mergedConfig.prefix); | ||
@@ -140,3 +143,3 @@ /** | ||
} | ||
if (GROUP_NAME_REGEXP.test(className)) { | ||
if (groupNameRegex.test(className)) { | ||
return; // Lazier is faster... processing next className! | ||
@@ -143,0 +146,0 @@ } |
@@ -7,2 +7,3 @@ /** | ||
const { separatorRegEx } = require('./regex'); | ||
// context.parserPath | ||
@@ -221,3 +222,2 @@ // /.../eslint-plugin-tailwindcss/node_modules/espree/espree.js | ||
} | ||
const separatorRegEx = /(\s+)/; | ||
let parts = classStr.split(separatorRegEx); | ||
@@ -224,0 +224,0 @@ if (parts[0] === '') { |
@@ -0,1 +1,3 @@ | ||
const { separatorRegEx } = require('../regex'); | ||
function bigSign(bigIntValue) { | ||
@@ -48,3 +50,3 @@ return (bigIntValue > 0n) - (bigIntValue < 0n); | ||
let result = ''; | ||
let parts = classStr.split(/(\s+)/); | ||
let parts = classStr.split(separatorRegEx); | ||
let classes = parts.filter((_, i) => i % 2 === 0); | ||
@@ -51,0 +53,0 @@ let whitespace = parts.filter((_, i) => i % 2 !== 0); |
{ | ||
"name": "eslint-plugin-tailwindcss", | ||
"version": "3.12.0", | ||
"version": "3.12.1-beta.0", | ||
"description": "Rules enforcing best practices while using Tailwind CSS", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
# eslint-plugin-tailwindcss | ||
![npm (scoped)](https://img.shields.io/npm/v/eslint-plugin-tailwindcss?style=for-the-badge) ![npm bundle size (scoped)](https://img.shields.io/npm/l/eslint-plugin-tailwindcss?style=for-the-badge) | ||
![npm latest version](https://img.shields.io/npm/v/eslint-plugin-tailwindcss?style=for-the-badge) ![license](https://img.shields.io/npm/l/eslint-plugin-tailwindcss?style=for-the-badge) ![downloads](https://img.shields.io/npm/dt/eslint-plugin-tailwindcss?style=for-the-badge) | ||
@@ -43,2 +43,4 @@ ![eslint-plugin-tailwindcss logo](.github/logo.png) | ||
- fix: [do not handle non-ASCII whitespace as separator](https://github.com/francoismassart/eslint-plugin-tailwindcss/pull/246) (by [uhyo](https://github.com/uhyo) π) | ||
- fix: [prefix support for named group/peer syntax](https://github.com/francoismassart/eslint-plugin-tailwindcss/pull/244) (by [bezbac](https://github.com/bezbac) π) | ||
- feat: [support tailwind config in typescript](https://github.com/francoismassart/eslint-plugin-tailwindcss/pull/242) (by [quesabe](https://github.com/quesabe) π) | ||
@@ -45,0 +47,0 @@ **You may have to upgrade your Tailwind CSS version to `3.3.2`** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
178780
28
4705
221
1