mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-21 02:22:13 +08:00
Add support for gjs template linting using embertemplate lint (#4653)
* super hacky way to get ember template lint to work on gjs files * Clean up code so we use a handler which means we reuse all the config also moves handler to the glimmer directory so it only fires for gjs files * fix tests
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
" Author: Adrian Zalewski <aazalewski@hotmail.com>
|
||||
Before:
|
||||
runtime ale_linters/handlebars/embertemplatelint.vim
|
||||
runtime autoload/ale/handlers/embertemplatelint.vim
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
@@ -44,7 +44,7 @@ Execute(The ember-template-lint handler should parse lines correctly):
|
||||
\ 'type': 'W',
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#handlebars#embertemplatelint#Handle(347, input_lines)
|
||||
\ ale#handlers#embertemplatelint#Handle(347, input_lines)
|
||||
|
||||
Execute(The ember-template-lint handler should handle template parsing error correctly):
|
||||
let input_lines = split('{
|
||||
@@ -70,12 +70,12 @@ Execute(The ember-template-lint handler should handle template parsing error cor
|
||||
\ 'type': 'E',
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#handlebars#embertemplatelint#Handle(347, input_lines)
|
||||
\ ale#handlers#embertemplatelint#Handle(347, input_lines)
|
||||
|
||||
Execute(The ember-template-lint handler should handle no lint errors/warnings):
|
||||
AssertEqual
|
||||
\ [],
|
||||
\ ale_linters#handlebars#embertemplatelint#Handle(347, [])
|
||||
\ ale#handlers#embertemplatelint#Handle(347, [])
|
||||
AssertEqual
|
||||
\ [],
|
||||
\ ale_linters#handlebars#embertemplatelint#Handle(347, ['{}'])
|
||||
\ ale#handlers#embertemplatelint#Handle(347, ['{}'])
|
||||
|
||||
Reference in New Issue
Block a user