Can't get this module to work with Webstorm / IntelliJ and pnpm
My pnpm monorepo is structured as follows:
- root
package.jsonwithouttailwindcssclientsfrontsrcpackage.jsonwithtailwindcsstailwind-config.tsrefers to thepackages/ui/tailwind-config.tsfile through thepresetsmechanism
- other clients, some using tw, some not…
packagesuipackage.jsonwithtailwindcsstailwind-config.tsthe 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?
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
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
Thank you for the fix @schoero, I have verified that the beta version fixes the issue in my IDE.