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

misc(jsconfig): Enable type checking for JavaScript #3589

Merged
merged 2 commits into from
Oct 17, 2017

Conversation

kdzwinel
Copy link
Collaborator

@kdzwinel kdzwinel commented Oct 17, 2017

Highlights errors in IDE, doesn't affect automatic linters.

checkJS:true

Doc: https://code.visualstudio.com/docs/languages/javascript (cmd+f "checkJs")
Can be disabled per file via // @ts-nocheck.

We could also add strict: true. I have hard time finding the docs for this, but from what I can see it doesn't allow implicit 'any' type and is able to recognize that function may return undefined while jsdoc says it should return a string.

checkJS:true; strict:true

@brendankenny
Copy link
Member

We could also add strict: true

obvs this is non-binding for now, but this seems like a good idea. If we have type checking some day we'll want to be strict with nulls/undefined

@kdzwinel
Copy link
Collaborator Author

@brendankenny 👍 added

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍

I'd guess strict does something similar to ts's strict which is just an alias for a couple useful flags?

--strictNullChecks
--noImplicitAny
--noImplicitThis
--alwaysStrict

https://blog.mariusschulz.com/2017/06/09/typescript-2-3-the-strict-compiler-option

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.

None yet

4 participants