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:
Sam
2024-02-23 15:30:12 +11:00
committed by GitHub
parent f38a802172
commit 5e8904cd3d
4 changed files with 79 additions and 63 deletions

View File

@@ -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, ['{}'])