allegro / typescript-strict-plugin

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

IDE support #20

Closed arsenij-melihov closed 2 years ago

arsenij-melihov commented 2 years ago

Hi! Is there a way to get errors in IDE? README says "They will show errors in your IDE but they won't appear during compilation", but I didn't find a way to get them. (I am using vscode).

Thanks in advance!

KostkaBrukowa commented 2 years ago

Can you share a link to your repository?

arsenij-melihov commented 2 years ago

I created a reproduction repo - https://github.com/arsenij-melihov/tsc-strict-ide-example. It contains ./src/index.ts file with the following code:

//@ts-strict
interface TestType {
  bar: string;
}

const foo: TestType | undefined = undefined;

console.log(foo.bar);

and default typescript-strict-plugin setup.

And vscode doesn't show me errors: image

KostkaBrukowa commented 2 years ago

I believe it is the same problem as with https://github.com/allegro/typescript-strict-plugin/issues/5#issuecomment-882106427. You need to choose your tsconfig as a main typescript configuration file and it should work

arsenij-melihov commented 2 years ago

You are absolutely, right! thx!