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

[Feature Request] Add CLI option to check specific files #26

Open hoovercj opened 2 years ago

hoovercj commented 2 years ago

I'd like to run this as a pre-commit hook and only check staged files so I can 1) Make sure no regressions are checked in 2) Check that new files aren't checked in with the ignore comment.

I think I could achieve 1) myself by creating a temporary tsconfig.json file with the staged files listed as files and feed that to the CLI, but it would be much better if the command could directly handle a list of files.

Is that technically possible?

For 2), I would also appreciate exposing a new cli command which takes a list of files and throws an error if any of them are ignored

kamkry commented 2 years ago

I think 1) goes beyond the scope of this project. As for 2) feel free to contribute if you want the feature soon, we don't have much time to do that right now 😄

yslpn commented 1 year ago

I think 1) goes beyond the scope of this project.

1) Disagree. In theory, we could use another package to typecheck a separate file, but it won't read @ts-strict-ignore comments from that package.

yslpn commented 1 year ago

I find this option very useful as it can be used in husky and lint-staged