Skip to content

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

Merged
paulirish merged 2 commits intoGoogleChrome:masterfrom
kdzwinel:check-js
Oct 17, 2017
Merged

misc(jsconfig): Enable type checking for JavaScript#3589
paulirish merged 2 commits intoGoogleChrome:masterfrom
kdzwinel:check-js

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
Contributor

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.

4 participants