2017-10-16 04:53:17 +00:00
|
|
|
Before:
|
|
|
|
Save g:ale_typescript_tslint_executable
|
|
|
|
Save g:ale_typescript_tslint_config_path
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
unlet! g:ale_typescript_tslint_executable
|
|
|
|
unlet! g:ale_typescript_tslint_config_path
|
|
|
|
unlet! b:ale_typescript_tslint_executable
|
|
|
|
unlet! b:ale_typescript_tslint_config_path
|
|
|
|
|
|
|
|
call ale#handlers#tslint#InitVariables()
|
2021-03-21 00:21:49 +00:00
|
|
|
call ale#test#SetDirectory('/testplugin/test/fixers')
|
2017-10-16 04:53:17 +00:00
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
|
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
|
|
|
|
Execute(The tslint callback should return the correct default values):
|
2018-07-15 17:24:53 +00:00
|
|
|
let g:ale_typescript_tslint_config_path = 'tslint.json'
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/prettier/testfile.ts')
|
2017-10-16 04:53:17 +00:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
2018-07-15 17:24:53 +00:00
|
|
|
\ 'command': ale#Escape('tslint')
|
2017-10-16 16:08:10 +00:00
|
|
|
\ . ' -c ' . ale#Escape('tslint.json')
|
2020-04-15 14:30:19 +00:00
|
|
|
\ . ' --outputAbsolutePaths --fix %t',
|
2017-10-16 04:53:17 +00:00
|
|
|
\ },
|
|
|
|
\ ale#fixers#tslint#Fix(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The tslint callback should include custom tslint config option):
|
|
|
|
let g:ale_typescript_tslint_config_path = '.tslintrc'
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/prettier/testfile.ts')
|
2017-10-16 04:53:17 +00:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
2018-07-15 17:24:53 +00:00
|
|
|
\ 'command': ale#Escape('tslint')
|
|
|
|
\ . ' -c ' . ale#Escape('.tslintrc')
|
2020-04-15 14:30:19 +00:00
|
|
|
\ . ' --outputAbsolutePaths --fix %t',
|
2017-10-16 04:53:17 +00:00
|
|
|
\ },
|
|
|
|
\ ale#fixers#tslint#Fix(bufnr(''))
|