allegro / typescript-strict-plugin

Typescript plugin that allows turning on strict mode in specific files or directories.
MIT License
332 stars 29 forks source link

The program object in the strict language service is no longer undefined #74

Closed kamkry closed 4 months ago

kamkry commented 4 months ago

The TypeScript instance retrieved from PluginModuleFactory parameters didn't match the one imported from typescript/lib/tsserverlibrary, causing the createLanguageService function to return a broken service with no program object inside.

The solution standardizes the usage to utilize a single instance of TypeScript and eliminates the .getProgram call since it's a getter function that doesn't perform any action.

KostkaBrukowa commented 4 months ago

Ye it works well for me

KostkaBrukowa commented 4 months ago

@kamkry or it doesn't. It fixed issue that was appearing on 5.2.2 but it didnt fix for 5.4. I've bring back e2e tests and it seems that they fail on typescript 5.4.5 and they work on 5.2.2 so it must be something different https://github.com/allegro/typescript-strict-plugin/pull/75 Also it seems that this line https://github.com/allegro/typescript-strict-plugin/blob/b797f25e7e5ff99e04917c348c4b84129856a6d1/src/plugin/index.ts#L23 causes this issue after some debugging

KostkaBrukowa commented 4 months ago

Done in #75