-
-
Notifications
You must be signed in to change notification settings - Fork 97
Description
Describe the bug
When a frontend project is nested within a monorepo, any linting process run not from the frontend folder does not see the tailwind config. This is especially apparent with VSCode intellisense - the eslint process is run at the project root level, while the tailwind config resides somewhere nested. Since the config is not found the plugin des not pick up any custom colours and other stuff.
To Reproduce
Assumed folder structure:
/rootProject
├ package.json
├ /frontend
│ ├ .eslintrc.js
│ ├ package.json
│ ├ tailwind.config.js
- When eslint is run from
rootProject
folder thetailwind.config.js
is not found. - When eslint is run from
frontend
folder thetailwind.config.js
is found. - eslint process in VSCode is run from
rootProject
and thus does not find thetailwind.config.js
.
BTW, the eslint config is picked up and the rules from eslint-plugin-tailwindcss
apply - they just don't use the custom theme and other settings.
Expected behavior
Tailwind config is discoverable as long as it is in the same folder with the eslint config.
Environment (please complete the following information):
- VSCode@1.77.3
- eslint@8.37.0
- tailwindcss@3.3.2
- eslint-plugin-tailwindcss@3.11.0
Additional context
Seems like this code is the reason for the behaviour:
https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/master/lib/util/customConfig.js#L26
The path.resolve()
resolves to the rootProject
folder, while the config is at rootProject/frontend
.
PS. I can make it work if I open the frontend
folder in a separate editor window. However it is very inconvenient in a large project.