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.13.2 to 1.13.3

38

lib/util/customConfig.js

@@ -6,7 +6,18 @@ 'use strict';

const REFRESH_RATE = 1000;
const CHECK_REFRESH_RATE = 1000;
let previousConfig = null;
let lastUpdate = null;
let lastCheck = null;
let mergedConfig = null;
let lastModifiedDate = null;
/**
* @see https://stackoverflow.com/questions/9210542/node-js-require-cache-possible-to-invalidate
* @param {string} module The path to the module
* @returns the module's export
*/
function requireUncached(module) {
delete require.cache[require.resolve(module)];
return require(module);
}
function loadConfig(config) {

@@ -16,4 +27,16 @@ let loadedConfig = null;

const resolved = path.resolve();
const resolvedPath = resolved + '/' + config;
try {
loadedConfig = require(resolved + '/' + config);
fs.stat(resolvedPath, (err, stats) => {
if (err) {
loadedConfig = {};
return;
}
if (lastModifiedDate !== stats.mtime) {
lastModifiedDate = stats.mtime;
loadedConfig = requireUncached(resolvedPath);
} else {
loadedConfig = null;
}
});
} catch (err) {

@@ -46,8 +69,11 @@ loadedConfig = {};

const newConfig = convertConfigToString(twConfig) !== convertConfigToString(previousConfig);
const expired = now - lastUpdate > REFRESH_RATE;
const expired = now - lastCheck > CHECK_REFRESH_RATE;
if (newConfig || expired) {
previousConfig = twConfig;
lastUpdate = now;
lastCheck = now;
const userConfig = loadConfig(twConfig);
mergedConfig = resolveConfig(userConfig);
// userConfig is null when config file was not modified
if (userConfig !== null) {
mergedConfig = resolveConfig(userConfig);
}
}

@@ -54,0 +80,0 @@ return mergedConfig;

2

package.json
{
"name": "eslint-plugin-tailwindcss",
"version": "1.13.2",
"version": "1.13.3",
"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