mirror of
https://github.com/dense-analysis/ale.git
synced 2026-08-15 20:27:58 +08:00
Move all functions for fixing things to autoload/ale/fixers, and only accept the lines of input where needed.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
" Author: tunnckoCore (Charlike Mike Reagent) <mameto2011@gmail.com>,
|
||||
" w0rp <devw0rp@gmail.com>
|
||||
" Description: Integration between Prettier and ESLint.
|
||||
|
||||
call ale#Set('javascript_prettier_eslint_executable', 'prettier-eslint')
|
||||
call ale#Set('javascript_prettier_eslint_use_global', 0)
|
||||
|
||||
function! ale#handlers#prettier_eslint#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'javascript_prettier_eslint', [
|
||||
\ 'node_modules/prettier-eslint-cli/index.js',
|
||||
\ 'node_modules/.bin/prettier-eslint',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#prettier_eslint#Fix(buffer, lines) abort
|
||||
let l:options = ale#Var(a:buffer, 'javascript_prettier_eslint_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(ale#handlers#prettier_eslint#GetExecutable(a:buffer))
|
||||
\ . ' %t'
|
||||
\ . ' ' . l:options
|
||||
\ . ' --write',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user