Ale: Linters for .tsx files

Created on 18 Jun 2018  路  9Comments  路  Source: dense-analysis/ale

Currently linting work for .ts files, but by default not works for .tsx.

Most helpful comment

I updated the default aliases to include javascriptreact and typescriptreact, now they are in Vim and NeoVim.

All 9 comments

You can set g:ale_linter_aliases for .tsx files so .ts linters are loaded for them. I'll consider making this the default for that filetype.

I haven't had any luck getting tsx files to lint even with the alias added. Perhaps I'm doing something wrong, has anyone been able to get it to work?

Found it, adding this for me worked:

let g:ale_linter_aliases = {'typescriptreact': 'typescript'}

Using linter aliases works for linting, but not for fixing. Can we inherit the linter aliases for fixing, or introduce an ale_fixer_aliases?

That wouldn't make sense. Fixers are restricted to any particular filetype, and you must configure them yourself, as ALE doesn't try to change your code in any way by default.

For .tsx files, the filetype I recommend using is typescript.tsx. That's the filetype used in this plugin: https://github.com/ianks/vim-tsx

Every Vim plugin I can find for tsx files sets with typescript.tsx or typescript as the filetype. I'll close this as there's nothing to do.

Every Vim plugin I can find for tsx files sets with typescript.tsx or typescript as the filetype.

FWIW, it looks like vim v0.8.1930 and neovim v0.4.0 sets the filetype to typescriptreact by default.

let g:ale_linter_aliases = {'typescriptreact': 'typescript'} worked for me

I updated the default aliases to include javascriptreact and typescriptreact, now they are in Vim and NeoVim.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sodiumjoe picture sodiumjoe  路  4Comments

ianchanning picture ianchanning  路  3Comments

arthuryangcs picture arthuryangcs  路  4Comments

trevordmiller picture trevordmiller  路  4Comments

chauncey-garrett picture chauncey-garrett  路  3Comments