From e3784c4c4ebb86bc0cdac3652b4f7e4b38ac554e Mon Sep 17 00:00:00 2001 From: w0rp Date: Thu, 19 Sep 2019 20:48:30 +0100 Subject: [PATCH] Close #2764 - Support the new React filetypes with aliases --- autoload/ale/linter.vim | 2 ++ doc/ale.txt | 2 ++ test/test_filetype_linter_defaults.vader | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/autoload/ale/linter.vim b/autoload/ale/linter.vim index 167dab1c..a85f06e2 100644 --- a/autoload/ale/linter.vim +++ b/autoload/ale/linter.vim @@ -12,10 +12,12 @@ let s:linters = {} let s:default_ale_linter_aliases = { \ 'Dockerfile': 'dockerfile', \ 'csh': 'sh', +\ 'javascriptreact': ['javascript', 'jsx'], \ 'plaintex': 'tex', \ 'rmarkdown': 'r', \ 'rmd': 'r', \ 'systemverilog': 'verilog', +\ 'typescriptreact': ['typescript', 'tsx'], \ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'], \ 'vimwiki': 'markdown', \ 'vue': ['vue', 'javascript'], diff --git a/doc/ale.txt b/doc/ale.txt index 9e4af075..832c2707 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -1041,10 +1041,12 @@ g:ale_linter_aliases *g:ale_linter_aliases* { \ 'Dockerfile': 'dockerfile', \ 'csh': 'sh', + \ 'javascriptreact': ['javascript', 'jsx'], \ 'plaintex': 'tex', \ 'rmarkdown': 'r', \ 'rmd': 'r', \ 'systemverilog': 'verilog', + \ 'typescriptreact': ['typescript', 'tsx'], \ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'], \ 'vimwiki': 'markdown', \ 'vue': ['vue', 'javascript'], diff --git a/test/test_filetype_linter_defaults.vader b/test/test_filetype_linter_defaults.vader index af028041..9c40cb23 100644 --- a/test/test_filetype_linter_defaults.vader +++ b/test/test_filetype_linter_defaults.vader @@ -66,3 +66,7 @@ Execute(The defaults for the verilog filetype should be correct): let g:ale_linters_explicit = 1 AssertEqual [], GetLinterNames('verilog') + +Execute(Default aliases for React should be defined): + AssertEqual ['javascript', 'jsx'], ale#linter#ResolveFiletype('javascriptreact') + AssertEqual ['typescript', 'tsx'], ale#linter#ResolveFiletype('typescriptreact')