Skip to content
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

tsconfig: Disable checking .js[x] files by default #20652

Closed
wants to merge 1 commit into from

Conversation

martinpitt
Copy link
Member

Pretending that all our *.js[x] files are meant to satisfy type checks is very annoying with vim/ALE, as it is now littered with e.g. "Parameter 'conn_to' implicitly has an 'any' type." in function declarations. It isn't possible to add annotations in .tsx files, and we are not going to port all our existing code anytime soon. Let's restrict the checks to .ts[x] files and drop the config override in test/static-code.


I don't understand the full ramifications of this change and don't know why it was introduced that way. Commit 9f7bd38 only talks about tsx files, not jsx. I confirmed that I still get typechecking errors in both ALE and test/static-code when I change/drop the annotations in e.g. pkg/lib/cockpit-components-context-menu.tsx

Pretending that all our *.js[x] files are meant to satisfy type checks
is very annoying with vim/ALE, as it is now littered with e.g.
"Parameter 'conn_to' implicitly has an 'any' type." in function
declarations. It isn't possible to add annotations in .tsx files, and
we are not going to port all our existing code anytime soon. Let's
restrict the checks to .ts[x] files and drop the config override in
test/static-code.
@martinpitt martinpitt added the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Jun 24, 2024
@allisonkarlitskaya
Copy link
Member

The logic here is exactly that it would be nice to see warnings in JavaScript files in the editor. That's why we override the config from test/static-code.

My personal response to all the noise is to port more stuff to TypeScript 😅

In reality though, I don't think checkJs is the real problem here but rather the combination of checkJs and strict.

In particular, I feel like non-strict checking of JS files would be extremely beneficial.

I don't know of a way to only disable strict mode for JS files, though.

@martinpitt martinpitt marked this pull request as draft June 25, 2024 13:34
@martinpitt martinpitt removed the request for review from allisonkarlitskaya June 25, 2024 13:34
@martinpitt
Copy link
Member Author

OK, that's not it, and I have too much other stuff to do, I'll just use that as a local hack for the time being.

@martinpitt martinpitt closed this Jun 26, 2024
@martinpitt martinpitt deleted the ts-js branch June 26, 2024 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-test For doc/workflow changes, or experiments which don't need a full CI run,
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants