microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 235 forks source link

How to disable type cheking for not ts files #744

Open max-mykhailenko opened 4 years ago

max-mykhailenko commented 4 years ago

Some of my projects use typescript, some not. But error messages I see across all project.

Type annotations can only be used in TypeScript files.

any

Will be better to check tsconfig file and only if it available — turn on plugin. What do you think?

orta commented 4 years ago

Is this in a flow file? It might be a good idea to check for a .flowconfig and disable the plugin

max-mykhailenko commented 4 years ago

Yes, it's flow file with flow pragma on top

orta commented 4 years ago

Yep, then I think I'd take a PR which has a lookup to see if the JS file lives inside a folder with a .flowconfig and disables the type checking.

DanielRosenwasser commented 4 years ago

You can also set "enable_language_service_for_javascript": false in your Preferences.sublime-settings instead. I think that's probably more ideal.