mirror of
https://github.com/dense-analysis/ale
synced 2024-12-28 09:02:24 +00:00
d28d7f732a
* Ember-template-lint Handlebars template linter: initial handler, test. * Handlebars support with ember-template-lint: basic documentation entries.
57 lines
1.4 KiB
Plaintext
57 lines
1.4 KiB
Plaintext
" Author: Adrian Zalewski <aazalewski@hotmail.com>
|
|
|
|
Before:
|
|
runtime ale_linters/handlebars/embertemplatelint.vim
|
|
|
|
Execute(The ember-template-lint handler should parse lines correctly):
|
|
let input_lines = split('{
|
|
\ "/ember-project/app/templates/application.hbs": [
|
|
\ {
|
|
\ "moduleId": "app/templates/application",
|
|
\ "rule": "bare-strings",
|
|
\ "severity": 2,
|
|
\ "message": "Non-translated string used",
|
|
\ "line": 1,
|
|
\ "column": 10,
|
|
\ "source": " Bare String\n"
|
|
\ },
|
|
\ {
|
|
\ "moduleId": "app/templates/application",
|
|
\ "rule": "invalid-interactive",
|
|
\ "severity": 1,
|
|
\ "message": "Interaction added to non-interactive element",
|
|
\ "line": 3,
|
|
\ "column": 6,
|
|
\ "source": "<span {{action someAction}}></span>"
|
|
\ }
|
|
\ ]
|
|
\ }', '\n')
|
|
|
|
AssertEqual
|
|
\ [
|
|
\ {
|
|
\ 'bufnr': 347,
|
|
\ 'lnum': 1,
|
|
\ 'col': 10,
|
|
\ 'text': 'bare-strings: Non-translated string used',
|
|
\ 'type': 'E',
|
|
\ },
|
|
\ {
|
|
\ 'bufnr': 347,
|
|
\ 'lnum': 3,
|
|
\ 'col': 6,
|
|
\ 'text': 'invalid-interactive: Interaction added to non-interactive element',
|
|
\ 'type': 'W',
|
|
\ },
|
|
\ ],
|
|
\ ale_linters#handlebars#embertemplatelint#Handle(347, input_lines)
|
|
|
|
Execute(The ember-template-lint handler should handle no lint errors/warnings):
|
|
AssertEqual
|
|
\ [
|
|
\ ],
|
|
\ ale_linters#handlebars#embertemplatelint#Handle(347, [])
|
|
|
|
After:
|
|
call ale#linter#Reset()
|