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 3.5.0-beta.1 to 3.5.0-beta.2

6

lib/rules/classnames-order.js

@@ -10,3 +10,2 @@ /**

const astUtil = require('../util/ast');
const order = require('../util/prettier/order');
const groupUtil = require('../util/groupMethods');

@@ -16,2 +15,4 @@ const removeDuplicatesFromClassnamesAndWhitespaces = require('../util/removeDuplicatesFromClassnamesAndWhitespaces');

const parserUtil = require('../util/parser');
const order = require('../util/prettier/order');
const createContextFallback = require('tailwindcss/lib/lib/setupContextUtils').createContext;

@@ -92,2 +93,3 @@ //------------------------------------------------------------------------------

const mergedConfig = customConfig.resolve(twConfig);
const contextFallback = officialSorting ? createContextFallback(mergedConfig) : null;

@@ -308,3 +310,3 @@ //----------------------------------------------------------------------

if (officialSorting) {
orderedClassNames = order(classNames, mergedConfig);
orderedClassNames = order(classNames, contextFallback);
for (let i = 0; i < orderedClassNames.length; i++) {

@@ -311,0 +313,0 @@ const w = whitespaces[i] ?? '';

@@ -1,4 +0,5 @@

var createContextFallback = require('tailwindcss/lib/lib/setupContextUtils').createContext;
var generateRulesFallback = require('tailwindcss/lib/lib/generateRules').generateRules;
var generatedMap = new Map();
function bigSign(bigIntValue) {

@@ -8,8 +9,12 @@ return (bigIntValue > 0n) - (bigIntValue < 0n);

function order(unordered, config) {
var context = createContextFallback(config);
function order(unordered, context) {
const classNamesWithOrder = [];
unordered.forEach((className) => {
const order =
generateRulesFallback(new Set([className]), context).sort(([a], [z]) => bigSign(z - a))[0]?.[0] ?? null;
let order;
if (generatedMap.has(className)) {
order = generatedMap.get(className);
} else {
order = generateRulesFallback(new Set([className]), context).sort(([a], [z]) => bigSign(z - a))[0]?.[0] ?? null;
generatedMap.set(className, order);
}
classNamesWithOrder.push([className, order]);

@@ -16,0 +21,0 @@ });

{
"name": "eslint-plugin-tailwindcss",
"version": "3.5.0-beta.1",
"version": "3.5.0-beta.2",
"description": "Rules enforcing best practices while using Tailwind CSS",

@@ -5,0 +5,0 @@ "keywords": [

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