eslint-plugin-tailwindcss
Advanced tools
Comparing version 3.10.1-beta.3 to 3.10.1-beta.4
@@ -48,7 +48,7 @@ /** | ||
config: { | ||
default: 'tailwind.config.js', | ||
// default: 'tailwind.config.js', | ||
type: ['string', 'object'], | ||
}, | ||
removeDuplicates: { | ||
default: true, | ||
// default: true, | ||
type: 'boolean', | ||
@@ -248,3 +248,3 @@ }, | ||
switch (true) { | ||
case !astUtil.isValidVueAttribute(node, classRegex): | ||
case !astUtil.isValidVueAttribute(node): | ||
return; | ||
@@ -251,0 +251,0 @@ case astUtil.isVLiteralValue(node): |
@@ -44,3 +44,3 @@ /** | ||
config: { | ||
default: 'tailwind.config.js', | ||
// default: 'tailwind.config.js', | ||
type: ['string', 'object'], | ||
@@ -192,3 +192,3 @@ }, | ||
switch (true) { | ||
case !astUtil.isValidVueAttribute(node, classRegex): | ||
case !astUtil.isValidVueAttribute(node): | ||
return; | ||
@@ -195,0 +195,0 @@ case astUtil.isVLiteralValue(node): |
@@ -45,3 +45,3 @@ /** | ||
config: { | ||
default: 'tailwind.config.js', | ||
// default: 'tailwind.config.js', | ||
type: ['string', 'object'], | ||
@@ -425,3 +425,3 @@ }, | ||
switch (true) { | ||
case !astUtil.isValidVueAttribute(node, classRegex): | ||
case !astUtil.isValidVueAttribute(node): | ||
return; | ||
@@ -428,0 +428,0 @@ case astUtil.isVLiteralValue(node): |
@@ -50,3 +50,3 @@ /** | ||
config: { | ||
default: 'tailwind.config.js', | ||
// default: 'tailwind.config.js', | ||
type: ['string', 'object'], | ||
@@ -303,3 +303,3 @@ }, | ||
switch (true) { | ||
case !astUtil.isValidVueAttribute(node, classRegex): | ||
case !astUtil.isValidVueAttribute(node): | ||
return; | ||
@@ -306,0 +306,0 @@ case astUtil.isVLiteralValue(node): |
@@ -44,3 +44,3 @@ /** | ||
config: { | ||
default: 'tailwind.config.js', | ||
// default: 'tailwind.config.js', | ||
type: ['string', 'object'], | ||
@@ -192,3 +192,3 @@ }, | ||
switch (true) { | ||
case !astUtil.isValidVueAttribute(node, classRegex): | ||
case !astUtil.isValidVueAttribute(node): | ||
return; | ||
@@ -195,0 +195,0 @@ case astUtil.isVLiteralValue(node): |
@@ -45,3 +45,3 @@ /** | ||
config: { | ||
default: 'tailwind.config.js', | ||
// default: 'tailwind.config.js', | ||
type: ['string', 'object'], | ||
@@ -220,3 +220,3 @@ }, | ||
switch (true) { | ||
case !astUtil.isValidVueAttribute(node, classRegex): | ||
case !astUtil.isValidVueAttribute(node): | ||
return; | ||
@@ -223,0 +223,0 @@ case astUtil.isVLiteralValue(node): |
@@ -55,3 +55,3 @@ /** | ||
config: { | ||
default: 'tailwind.config.js', | ||
// default: 'tailwind.config.js', | ||
type: ['string', 'object'], | ||
@@ -66,3 +66,3 @@ }, | ||
type: 'number', | ||
default: 5_000, | ||
// default: 5_000, | ||
}, | ||
@@ -192,3 +192,3 @@ tags: { | ||
switch (true) { | ||
case !astUtil.isValidVueAttribute(node, classRegex): | ||
case !astUtil.isValidVueAttribute(node): | ||
return; | ||
@@ -195,0 +195,0 @@ case astUtil.isVLiteralValue(node): |
@@ -39,12 +39,10 @@ /** | ||
* @param {ASTNode} node The AST node being checked | ||
* @param {String} classRegex Regex to test the attribute that is being checked against | ||
* @returns {Boolean} | ||
*/ | ||
function isVueClassAttribute(node, classRegex) { | ||
const re = new RegExp(classRegex); | ||
let name = ''; | ||
function isVueClassAttribute(node) { | ||
switch (true) { | ||
case node.key && node.key.name && re.test(node.key.name): | ||
case node.key && /^class$/.test(node.key.name): | ||
// class="vue-classes-as-litteral" | ||
return true; | ||
break; | ||
case node.key && | ||
@@ -56,6 +54,7 @@ node.key.name && | ||
/^bind$/.test(node.key.name.name) && | ||
re.test(node.key.argument.name): | ||
/^class$/.test(node.key.argument.name): | ||
// v-bind:class="vue-classes-as-bind" | ||
// :class="vue-classes-as-bind" | ||
return true; | ||
break; | ||
default: | ||
@@ -160,7 +159,6 @@ return false; | ||
* @param {ASTNode} node The AST node being checked | ||
* @param {String} classRegex Regex to test the attribute that is being checked against | ||
* @returns {Boolean} | ||
*/ | ||
function isValidVueAttribute(node, classRegex) { | ||
if (!isVueClassAttribute(node, classRegex)) { | ||
function isValidVueAttribute(node) { | ||
if (!isVueClassAttribute(node)) { | ||
// Only run for class attributes | ||
@@ -167,0 +165,0 @@ return false; |
{ | ||
"name": "eslint-plugin-tailwindcss", | ||
"version": "3.10.1-beta.3", | ||
"version": "3.10.1-beta.4", | ||
"description": "Rules enforcing best practices while using Tailwind CSS", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
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
173551
4613