mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-09 04:52:29 +08:00
Working directories are now set seperately from the commands so they can later be swapped out when running linters over projects is supported, and also better support filename mapping for running linters on other machines in future.
38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
Before:
|
|
Save g:ale_stylelint_options
|
|
|
|
let g:ale_stylelint_options = ''
|
|
|
|
call ale#assert#SetUpFixerTest('css', 'stylelint')
|
|
|
|
After:
|
|
call ale#assert#TearDownFixerTest()
|
|
|
|
Execute(The stylelint callback should return the correct default values):
|
|
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.css')
|
|
|
|
AssertFixer
|
|
\ {
|
|
\ 'read_temporary_file': 1,
|
|
\ 'cwd': '%s:h',
|
|
\ 'command': (has('win32') ? 'node.exe ' : '')
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/stylelint/bin/stylelint.js'))
|
|
\ . ' %t'
|
|
\ . ' --fix',
|
|
\ }
|
|
|
|
Execute(The stylelint callback should include custom stylelint options):
|
|
let g:ale_stylelint_options = '--cache'
|
|
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.css')
|
|
|
|
AssertFixer
|
|
\ {
|
|
\ 'read_temporary_file': 1,
|
|
\ 'cwd': '%s:h',
|
|
\ 'command': (has('win32') ? 'node.exe ' : '')
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/stylelint/bin/stylelint.js'))
|
|
\ . ' %t'
|
|
\ . ' --cache'
|
|
\ . ' --fix',
|
|
\ }
|