eslint-plugin-readable-tailwind icon indicating copy to clipboard operation
eslint-plugin-readable-tailwind copied to clipboard

Can't get this module to work with Webstorm / IntelliJ and pnpm

Open paour opened this issue 5 months ago • 3 comments

My pnpm monorepo is structured as follows:

  • root
    • package.json without tailwindcss
    • clients
      • front
        • src
        • package.json with tailwindcss
        • tailwind-config.ts refers to the packages/ui/tailwind-config.ts file through the presets mechanism
      • other clients, some using tw, some not…
    • packages
      • ui
        • package.json with tailwindcss
        • tailwind-config.ts the main TW3 config

There is no tailwindcss in the root of the project. When I run pnpm lint from the command-line, everything works because pnpm runs lint from each sub-project, so better-tailwind can find the tailwind version.

When I use the eslint plugin in IntelliJ, however, I get the following error:

Error: ENOENT: no such file or directory, open 'tailwindcss/package.json'
    at readFileSync (node:fs:449:20)
    at file:///ROOTFOLDER/node_modules/.pnpm/[email protected][email protected][email protected][email protected]_ts-node@1_s6ta5zy4h44whk6mhmvrunjwiq/node_modules/eslint-plugin-better-tailwindcss/lib/esm/async-utils/version.js:27:40

If I patch the package to return a hard-coded version object, it works fine. Could you improve the search algorithm to fix this?

paour avatar Aug 08 '25 08:08 paour

Same issue

Error: ENOENT: no such file or directory, open 'tailwindcss/package.json'
    at readFileSync (node:fs:442:20)
    at file:///Volumes/workspaces/fronted-monorepo/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/eslint-plugin-better-tailwindcss/lib/esm/async-utils/version.js:25:40

Garfield550 avatar Aug 20 '25 07:08 Garfield550

This should be fixed in the next major version. I have released a beta version for the next major release.

Note that the beta version already contains some breaking changes and more breaking changes will be added before the final release.

You can install the beta version using the following command:

pnpm add eslint-plugin-better-tailwindcss@beta

schoero avatar Sep 13 '25 10:09 schoero

Thank you for the fix @schoero, I have verified that the beta version fixes the issue in my IDE.

paour avatar Sep 15 '25 06:09 paour