eslint-plugin-tailwindcss
Advanced tools
Comparing version 1.17.2 to 2.0.0-beta.0
@@ -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,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": "1.17.2", | ||
"version": "2.0.0-beta.0", | ||
"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
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
94740
2781
1