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

Plugin is not working on a Directories #7

Closed shsuman closed 3 years ago

shsuman commented 3 years ago

Working fine with //@ts-strict but doesn't work when I set { ... "plugins": [ { "name": "typescript-strict-plugin", "paths": [ "./src/v2" ] } ] }

KostkaBrukowa commented 3 years ago

Can you provide some more information? What is your folder structure? Maybe a sample repo to clone for us to check what's wrong?

shsuman commented 3 years ago

Here's a repo that I created: https://github.com/shsuman/ts-plugin-test

It has a file ./src/v2/1.ts. And the tsconfig looks like this. { "compilerOptions": { "allowJs": true, "alwaysStrict": true, "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "forceConsistentCasingInFileNames": true, "module": "commonjs", "moduleResolution": "node", "noUnusedLocals": true, "outDir": "./dist", "baseUrl": "./src", "plugins": [ { "name": "typescript-strict-plugin", "paths": [ "./src/v2" ] } ], "resolveJsonModule": true, "skipLibCheck": true, "sourceMap": true, "strict": false, "target": "es6" } }

When I open it in VSCode, no errors are shown in the editor, however when I add the comment "//@ts-strict", it works fine.

KostkaBrukowa commented 3 years ago

Hmmm... i've cloned the repository and I have an error there. Are you sure that you have correct typescript version selected as shown in last screenshot below?

Zrzut ekranu 2021-08-20 o 12 05 41 Zrzut ekranu 2021-08-20 o 12 05 46 image

shsuman commented 3 years ago

@KostkaBrukowa, Are you testing on a windows machine or Linux machine ? I am on a windows machine.

KostkaBrukowa commented 3 years ago

I'm testing on MacOS. Good idea I'll check on Windows machine and see if it works there

shsuman commented 3 years ago

And yes, I do have the correct typescript version selected :)

KostkaBrukowa commented 3 years ago

Ok. Thanks for submitting the issue. There is an error on windows machines due to having \ instead of / in paths and different endlines. PR is on the way. Thanks again