Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-tailwindcss

Package Overview
Dependencies
Maintainers
1
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-tailwindcss - npm Package Compare versions

Comparing version 1.16.1 to 1.17.0-beta.0

7

lib/rules/classnames-order.js

@@ -223,5 +223,6 @@ /**

if (arg === null) {
originalClassNamesValue = node.value.value;
start = node.value.range[0] + 1;
end = node.value.range[1] - 1;
originalClassNamesValue = astUtil.extractValueFromNode(node);
const range = astUtil.extractRangeFromNode(node);
start = range[0] + 1;
end = range[1] - 1;
} else {

@@ -228,0 +229,0 @@ switch (arg.type) {

@@ -50,5 +50,11 @@ /**

function isLiteralAttributeValue(node) {
if (node.value && node.value.type === 'Literal') {
// No support for dynamic or conditional...
return !/\{|\?|\}/.test(node.value.value);
if (node.value) {
switch (node.value.type) {
case 'Literal':
// No support for dynamic or conditional...
return !/\{|\?|\}/.test(node.value.value);
case 'JSXExpressionContainer':
// className={"..."}
return node.value.expression.type === 'Literal';
}
}

@@ -94,2 +100,20 @@ return false;

function extractRangeFromNode(node) {
switch (node.value.type) {
case 'JSXExpressionContainer':
return node.value.expression.range;
default:
return node.value.range;
}
}
function extractValueFromNode(node) {
switch (node.value.type) {
case 'JSXExpressionContainer':
return node.value.expression.value;
default:
return node.value.value;
}
}
/**

@@ -109,3 +133,3 @@ * Inspect and parse an abstract syntax node and run a callback function

if (arg === null) {
originalClassNamesValue = node.value.value;
originalClassNamesValue = extractValueFromNode(node);
classNames = attrUtil.getClassNamesFromAttribute(originalClassNamesValue, true);

@@ -178,2 +202,4 @@ classNames = removeDuplicatesFromArray(classNames);

module.exports = {
extractRangeFromNode,
extractValueFromNode,
isValidJSXAttribute,

@@ -180,0 +206,0 @@ isValidVueAttribute,

{
"name": "eslint-plugin-tailwindcss",
"version": "1.16.1",
"version": "1.17.0-beta.0",
"description": "Rules enforcing best practices while using Tailwind CSS",

@@ -35,4 +35,6 @@ "keywords": [

"@tailwindcss/typography": "^0.4.0",
"@typescript-eslint/parser": "^4.33.0",
"eslint": "^7.1.0",
"mocha": "^7.2.0",
"typescript": "4.3.5",
"vue-eslint-parser": "^7.6.0"

@@ -39,0 +41,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc