mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-09 04:52:29 +08:00
Add StandardJS for TypeScript linting and fixing.
This commit is contained in:
31
test/fixers/test_standardts_fixer_callback.vader
Normal file
31
test/fixers/test_standardts_fixer_callback.vader
Normal file
@@ -0,0 +1,31 @@
|
||||
Before:
|
||||
call ale#test#SetDirectory('/testplugin/test/fixers')
|
||||
|
||||
unlet! b:ale_typescript_standard_executable
|
||||
unlet! b:ale_typescript_standard_options
|
||||
|
||||
After:
|
||||
call ale#test#RestoreDirectory()
|
||||
|
||||
Execute(The executable path should be correct):
|
||||
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.js')
|
||||
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': (has('win32') ? 'node.exe ' : '')
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/standard/bin/cmd.js'))
|
||||
\ . ' --fix %t',
|
||||
\ },
|
||||
\ ale#fixers#standardts#Fix(bufnr(''))
|
||||
|
||||
Execute(Custom options should be supported):
|
||||
let b:ale_typescript_standard_use_global = 1
|
||||
let b:ale_typescript_standard_options = '--foo-bar'
|
||||
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': ale#Escape('standard') . ' --foo-bar --fix %t',
|
||||
\ },
|
||||
\ ale#fixers#standardts#Fix(bufnr(''))
|
||||
Reference in New Issue
Block a user