Resolve new configs in shallow-cloned monorepo on CI#357
Resolve new configs in shallow-cloned monorepo on CI#357hasparus wants to merge 1 commit intofrancoismassart:masterfrom
Conversation
If the config path changed, we now resolve even if the new and old configs were modified at the same time. This helps with monorepos in shallow clones on Continuous Integration environments.
|
This seems to also be fixing an issue I'm having with VSCode's ESLint extension in my monorepo. Which is: whenever I open a file from a lib/app that doesn't have an eslint config (like suggested here, the plugin's linting will fail and won't update until I restart the ESLint server (VSCode's extension). But then if I open the file again it's back to the broken state. I'm quite certain the config is setup correctly as running lint through CLI reports everything as expected, no matter if running from monorepo root or from the library's root. It's only the VSCode ESLint extension. After everything I've tried (also setting It is quite frustrating to say the least 😔 Here's a video demonstration: Screen.Recording.3.movSetup is pretty simple:
{
root: true,
extends : [
// ...
"plugin:tailwindcss/recommended"
]
// Nothing else specifcally setup for eslint-plugin-tailwindcss
}
module.exports = {
extends: ["../../.eslintrc.json"],
settings: {
tailwindcss: {
config: require.resolve("./tailwind.config.js"),
},
},
};The const { createGlobPatternsForDependencies } = require("@nx/react/tailwind");
const { join } = require("path");
const baseConfig = require("../../libs/styles/tailwind.preset");
/** @type {import('tailwindcss').Config} */
module.exports = {
presets: [baseConfig],
content: [
join(__dirname, "{src,pages,components,app}/**/*!(*.stories|*.spec).{ts,tsx,html}"),
...createGlobPatternsForDependencies(__dirname),
],
};Is this also an issue others are facing? Or am I missing something completely? |
|
@devalberg I'll try to keep my fork up to date until @francoismassart has time to look into this. |
|
@devalberg I'm also facing this issue in VS Code in a similar monorepo configuration and as you said the only solution is to restart the ESLint server. I hope this PR will be merged in soon. |
|
@francoismassart should I add end-to-end tests for this? |
Pull Request Name
Resolve new configs in shallow-cloned monorepo on CI
Description
If the config path changed, we now resolve even if the new and old configs were modified at the same time. This helps with monorepos in shallow clones on Continuous Integration environments.
I plumbed the
newConfigflag down toloadConfigfunction, as we've already modified the previous path.Type of change
How Has This Been Tested?
I lazily ran this on CI in a PR I'm working on: graphql-hive/console#5466
Would probably need a proper e2e/integration test.
Test Configuration:
Checklist: