[heft-lint] Adds support for using lint plugin without typescript phase#5239
Conversation
|
Getting some test failures in unrelated packages? Not sure how they were impacted by this change... |
dmichon-msft
left a comment
There was a problem hiding this comment.
Nothing may execute inside of apply, the actual work needs to happen in runAsync to ensure correct timing.
The trickery with the TypeScript accessor somewhat hides the execution but ensures it happens after TypeScript has finished.
|
I refactored a fair bit in response to review feedback, ready for another pass I think. |
|
@iclanton @dmichon-msft should be ready for a final review now. |
dmichon-msft
left a comment
There was a problem hiding this comment.
Looks pretty good now, though there are some simplifications that may be worth making.
|
@iclanton @dmichon-msft any chance we could get this merged and published today I'd like to replace the official implementation into my local repo. |
Summary
The heft-lint-plugin currently requires a typescript plugin to be running in the same phase to retrieve the list of changed files. This makes it more efficient, but also prevents you from using the lint plugin in other standalone heft tasks.
See zulip thread here : https://rushstack.zulipchat.com/#narrow/channel/262522-heft/topic/.E2.9C.94.20.5Bheft-lint-plugin.5D.20Can.20it.20run.20on.20its.20own.3F/with/440265323
Details
Modified the plugin to create a TSProgram and extract the list of source files for the tsconfig when the typescript plugin is not accessed from the heft task session.
How it was tested
Manually used the plugin within another repository and confirmed it runs. Looks like this plugin has no real tests right now?
Impacted documentation