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

Feature request: Nx.dev compatibility #32

Open binary64 opened 2 years ago

binary64 commented 2 years ago

Hi I love the idea of your plugin. I'm trying to get it to work in my monorepo, which uses Nx.dev.

Here's how you can get a repo locally to test with:

npm i -g yarn && \
rm -rf ~/nx-demo && \
cd ~/ && \
npx create-nx-workspace nx-demo --packageManager=yarn --style=less --nx-cloud=false --interactive=false --preset=empty --linter=eslint && \
cd nx-demo

I currently get this error

Error: Command failed with exit code 1: tsc --showConfig
error TS5081: Cannot find a tsconfig.json file at the current directory: C:/p/nx_test.

Many thanks!

kamkry commented 2 years ago

Hi, you can quickly fix it either by renaming tsconfig.base.json to tsconfig.json, or by adding new tsconfig.json with following body:

{
  "extends": "./tsconfig.base.json",
}
binary64 commented 2 years ago

I tried both of your suggests, but I run node_modules/.bin/update-strict-comments I get:

Project does not contain any strict files.

Any ideas? It's a pretty plain Nx repo

kamkry commented 2 years ago

Does your project include any typescript files? That error is thrown only when either there's no TS files or every TS file is ignored with //@ts-strict-ignore comment

binary64 commented 2 years ago

Yes, I only have mostly .tsx and .ts files. And a couple of .js files.

I don't have any @ts-strict-ignore's

anatter commented 1 year ago

@binary64 I currently have the same issue, have you found a solution yet?

TheBox193 commented 1 year ago

Same here. Looks like this plugin lacks support for entry points for projects with multiple tsconfig files.