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

Doesn't work with TS 5.2. No errors shown at all. #57

Closed zorzysty closed 11 months ago

zorzysty commented 12 months ago

The plugin works fine with TS 5.1.6, but upgrading to 5.2.2 with the plugin enabled, completely turns off any TS errors in the IDE (not only strict mode errors - all others as well). This happens both in VSCode and Webstorm.

Dropping to 5.1.6 makes the plugin work again, and removing the plugin makes 5.2.2 show "normal" (non-strict) errors in the IDE.

zorzysty commented 11 months ago

I've managed to dig this up from IDE's logs:

#c.i.l.j.s.JSLanguageServiceQueue - Service internal error: Error processing request. Cannot read properties of undefined (reading 'getSyntacticDiagnostics')
TypeError: Cannot read properties of undefined (reading 'getSyntacticDiagnostics')

Could be useful for debugging this.

@KostkaBrukowa If you have some rough idea of what might be causing this and could point me in a right direction, I'd be happy to contribute.

KostkaBrukowa commented 11 months ago

Hey! Sorry for delay. @kamkry actually found the culprit: here and here should be

info.project['compilerOptions'].strict = true;

so the API changed in TS 5.2.2

kamkry commented 11 months ago

Hi @zorzysty! We released the fix in the latest beta, could you check if it's working correctly now?

npm i typescript-strict-plugin@2.2.1-beta.1
zorzysty commented 11 months ago

@kamkry It's definitely better, thank you! But something is still a bit off. Now I see strict mode errors when I open and edit a file, but they disappear when I restart TS Language server or change anything in tsconfig.json. To get them back, I need to reopen or edit the file. This is not happening with 5.1.6 and the previous version of the plugin.

zorzysty commented 11 months ago

@kamkry I've been working with the beta version for a few days now, and I must say the issue I mentioned above is not really a problem. I'd be very happy if this fix gets merged to the stable branch, so we can start using it team-wide :) Any idea when that could happen?

kamkry commented 11 months ago

@zorzysty We tried to quickly find the problem but we need more time. It's good to hear the fix helped you, I opened the pull request and we'll try to release it as soon as it's possible, thank you for creating the issue 😄