On webstorm eslint setting, there is an "extra eslint options" field. In this, I added:
--ext .ts
from the eslint documentation which is supposed to allow eslint to work on custom file extension, in this case .ts files. This does nothing. Is my syntax wrong ? Anyway to enable Eslint on .ts files, maybe from the .eslintrc file ?
--ext
allows using custom javascript extensions, you can't force ESLint to work for languages other than JavaScript by passing a different file extension to it.
You can try using typescript-eslint-parser to enable ESLint for Typescript - it allows building a syntax tree from typescript code that can be passed to ESLint for linting.
But I'd suggest using Typescript linters for inspecting TypeScript code. You can try TSLint, for example.
Update: since 2017.1.3, WebStorm supports ESLint + typescript-eslint-parser; you just need to install both typescript
plugin and typescript-eslint-parser
and modify your ESLint config accordingly:
"parser": "typescript-eslint-parser",
"plugins": ["typescript"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With