-
Notifications
You must be signed in to change notification settings - Fork 85
Description
Describe the bug
When generating a MonorepoTsProject, the generated ESLint configuration seems set up to include the projenrc configuration files... But the structure of the eslint task only runs lint in the monorepo packages so does not capture the monorepo-level projen code.
Expected Behavior
Default ESLint configuration for a MonorepoTsProject should also lint .projenrc.ts and projenrc/**.ts files
Current Behavior
I see the created root eslintrc.json seems to explicitly provision for linting the projenrc config files:
{
"ignorePatterns": [
"packages/**/*.*",
"!.projenrc.ts",
"!projenrc/**/*.ts"
],
...
"overrides": [
{
"files": [
".projenrc.ts"
],
"rules": {
"@typescript-eslint/no-require-imports": "off",
"import/no-extraneous-dependencies": "off"
}
}
]
}
...But the generated tasks.json task just runs eslint in sub-packages via nx - which won't capture the top-level linting:
npx nx run-many --target=eslint --output-style=stream --nx-bailReproduction Steps
npx projen new --from @aws/pdk monorepo-ts- Edit your
.projenrc.tsfile with some whitespace error that prettier/eslint should catch - Run
npm run eslint: The projenrc file will not be re-formatted.
Possible Solution
Maybe MonorepoTsProject should add an additional step to the eslint task to run at the root/monorepo level?
I'm tentatively working around it for now with:
monorepo.eslint?.eslintTask.prependExec(
"eslint --ext .ts,.tsx --fix --no-error-on-unmatched-pattern $@ .projenrc.ts projenrc",
);Additional Information/Context
No response
PDK version used
0.23.44
What languages are you seeing this issue on?
Typescript
Environment details (OS name and version, etc.)
macOS, projen v0.82.8