francoismassart / eslint-plugin-tailwindcss

ESLint plugin for Tailwind CSS usage
https://www.npmjs.com/package/eslint-plugin-tailwindcss
MIT License
1.47k stars 70 forks source link

fix(loadConfig): Fix date comparison in loadConfig #344

Closed rpereira-anchor closed 3 months ago

rpereira-anchor commented 3 months ago

Pull Request Name

Fix date comparison in loadConfig

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #343

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Tested locally to see if it indeed uses the cached config Place a console.log inside each if statement

      if (stats === null) {
        loadedConfig = {};
         console.log("1")
      } else if (lastModifiedDate !== stats.mtime.getTime()) {
        lastModifiedDate = stats.mtime.getTime();
        loadedConfig = requireUncached(resolvedPath);
         console.log("2")
      } else {
        loadedConfig = null;
         console.log("3")
      }

2 appears once followed by multiple instances of 3

Test Configuration:

Checklist:

francoismassart commented 3 months ago

Hi @rpereira-anchor, please try out this beta version which should fix your issue:

npm i eslint-plugin-tailwindcss@3.17.3-beta.3 -D

Thank you for your feedback

francoismassart commented 3 months ago

Should be fixed in latest release (3.17.4)

rpereira-anchor commented 3 months ago

comfirmed as fixed