Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): resolve eslint plugins relative to cdk-build-tools #5528

Merged
merged 2 commits into from
Dec 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tools/cdk-build-tools/lib/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export async function compileCurrentPackage(timers: Timers, options: CDKBuildOpt
'.',
'--ext=.js,.ts',
'--ignore-path=.gitignore',
'--no-eslintrc', // ignore local .eslintrc files
`--resolve-plugins-relative-to=${__dirname}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'll only work "by luck" because everything is hoisted to the root. Most of the linters are, in fact, installed by dependency of cdk-build-tools and expected to resolve relative to there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__dirname is cdk-build-tools/lib which will resolve to the deps of cdk-build-tools, no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I somehow though about it in the other way around. The actual problem at hand is caused (or maybe also caused) by missing --no-eslintrc here actually.

...options.eslint?.["ignore-pattern"]?.map(pattern => `--ignore-pattern=${pattern}`) || []
], { timers });
await shell([compilers.tslint || require.resolve('tslint/bin/tslint'), '--project', '.'], { timers });
Expand Down