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.1.2 to 3.2.0-beta.0

7

lib/rules/no-custom-classname.js

@@ -55,2 +55,6 @@ /**

},
cssFilesRefreshRate: {
type: 'number',
default: 5_000,
},
tags: {

@@ -76,2 +80,3 @@ type: 'array',

const cssFiles = getOption(context, 'cssFiles');
const cssFilesRefreshRate = getOption(context, 'cssFilesRefreshRate');
const whitelist = getOption(context, 'whitelist');

@@ -87,3 +92,3 @@

const groups = groupUtil.getGroups(defaultGroups, mergedConfig);
const classnamesFromFiles = getClassnamesFromCSS(cssFiles);
const classnamesFromFiles = getClassnamesFromCSS(cssFiles, cssFilesRefreshRate);

@@ -90,0 +95,0 @@ /**

8

lib/util/cssFiles.js

@@ -8,5 +8,4 @@ 'use strict';

const REFRESH_RATE = 5000;
let previousGlobsResults = [];
let lastUpdate = new Date().getTime() - REFRESH_RATE;
let lastUpdate = null;
let classnamesFromFiles = [];

@@ -17,9 +16,10 @@

* @param {Array} patterns Glob patterns to locate files
* @param {Number} refreshRate Interval
* @returns {Array} List of classnames
*/
const generateClassnamesListSync = (patterns) => {
const generateClassnamesListSync = (patterns, refreshRate = 5_000) => {
const now = new Date().getTime();
const files = fg.sync(patterns);
const newGlobs = previousGlobsResults.flat().join(',') != files.flat().join('');
const expired = now - lastUpdate > REFRESH_RATE;
const expired = lastUpdate === null || now - lastUpdate > refreshRate;
if (newGlobs || expired) {

@@ -26,0 +26,0 @@ previousGlobsResults = files;

@@ -7,3 +7,3 @@ 'use strict';

const CHECK_REFRESH_RATE = 1000;
const CHECK_REFRESH_RATE = 1_000;
let previousConfig = null;

@@ -10,0 +10,0 @@ let lastCheck = null;

{
"name": "eslint-plugin-tailwindcss",
"version": "3.1.2",
"version": "3.2.0-beta.0",
"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