Skip to content

Add --project and -p command line option #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
codeBelt opened this issue Nov 1, 2021 · 3 comments · Fixed by #13
Closed

Add --project and -p command line option #11

codeBelt opened this issue Nov 1, 2021 · 3 comments · Fixed by #13
Labels
enhancement New feature or request

Comments

@codeBelt
Copy link

codeBelt commented Nov 1, 2021

Currently we use "strict": true but have "strictNullChecks": false. When we run yarn tsc-strict we get 🎉 All files passed.

{
 "compilerOptions": {
   ...
   "strict": true,
   "strictNullChecks": false,
   "plugins": [
    {
     "name": "typescript-strict-plugin"
    }
   ]
 }
}

I am not sure how the plugin should work but I thought it would ignore the strictNullChecks and make it true.

I would like to keep the tsconfig.json as is and not remove "strictNullChecks": false so it can work with our current workflow. Can you allow tsc-strict to take the --project and -p command line options so we can point to another file (tsc-strict -p tsconfig-strict.json)?

@codeBelt
Copy link
Author

codeBelt commented Nov 1, 2021

I ended up renaming tsconfig.json to tsconfig-base.json and made tsconfig.json look like:

{
  "extends": "./tsconfig-base.json",
  "compilerOptions": {
    "strictNullChecks": true,
    "plugins": [
      {
        "name": "typescript-strict-plugin",
        "paths": ["./src/stores/", "./src/utils/"]
      }
    ]
  }
}

I think this works better because now my IDE displays the stricter warnings/errors but our build process can use the less strict version.

Maybe there should be a way to tell tsc-strict to override strictNullChecks or one of the other option(s) that is combined under the strict option? Then I wouldn't have to do the tsconfig extend thing.

@codeBelt
Copy link
Author

codeBelt commented Nov 3, 2021

I guess my team is not liking all the strict null warnings in the IDE. Maybe allowing tsc-strict to accept the --project and -p command line options is not a bad idea. Then I can slowly clean up the null warnings without the team seeing them.

@KostkaBrukowa
Copy link
Collaborator

To be honest we could actually pass all the arguments that typescript supports to the tsc not only --project. Right now we only pass --strict --noEmit but adding support to pass --project and the rest would be nice feature. I'll try to add this over the weekend. Thanks for the idea

@KostkaBrukowa KostkaBrukowa added the enhancement New feature or request label Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants