Skip to content

Conversation

mkarajohn
Copy link

This pr allows the tool to handle JS files as well when the allowJs and checkJs are explicitly enabled in the user's config.

Resolves issues in the scenario when tsc-files runs as part of lint-staged over ts, tsx, js and jsx files.

If we do not handle JS files in this scenario, then they get passed along with the non-files arguments and we get the error about not being possible to mix -p along with files

@jonasgeiler
Copy link

jonasgeiler commented May 28, 2024

I don't believe you have to check if allowJs and checkJs are enabled. It's probably fine to just always look for .js files and .ts files in the CLI arguments, since you wouldn't pass JS files to tsc-files if you didn't want tsc-files to check them, right? Same as you wouldn't give JS files to tsc if you didn't want tsc to check them.

At least that's what I did in my fork at @jonasgeiler/tsc-files.

Also kind of a duplicate of #55.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants