Add prettier-standard support (#702)
* Add prettier-standard support * Update ale-javascript.txt Remove a duplicated header line.
This commit is contained in:
parent
8846a8860f
commit
7eec1f2efc
@ -84,7 +84,7 @@ name. That seems to be the fairest way to arrange this table.
|
||||
| Haskell | [ghc](https://www.haskell.org/ghc/), [ghc-mod](https://github.com/DanielG/ghc-mod), [hlint](https://hackage.haskell.org/package/hlint), [hdevtools](https://hackage.haskell.org/package/hdevtools) |
|
||||
| HTML | [HTMLHint](http://htmlhint.com/), [proselint](http://proselint.com/), [tidy](http://www.html-tidy.org/) |
|
||||
| Java | [checkstyle](http://checkstyle.sourceforge.net), [javac](http://www.oracle.com/technetwork/java/javase/downloads/index.html) |
|
||||
| JavaScript | [eslint](http://eslint.org/), [jscs](http://jscs.info/), [jshint](http://jshint.com/), [flow](https://flowtype.org/), [standard](http://standardjs.com/), [prettier](https://github.com/prettier/prettier) (and `prettier-eslint`), [xo](https://github.com/sindresorhus/xo)
|
||||
| JavaScript | [eslint](http://eslint.org/), [jscs](http://jscs.info/), [jshint](http://jshint.com/), [flow](https://flowtype.org/), [standard](http://standardjs.com/), [prettier](https://github.com/prettier/prettier) (and `prettier-eslint`, `prettier-standard`), [xo](https://github.com/sindresorhus/xo)
|
||||
| JSON | [jsonlint](http://zaa.ch/jsonlint/) |
|
||||
| Kotlin | [kotlinc](https://kotlinlang.org), [ktlint](https://ktlint.github.io) see `:help ale-integration-kotlin` for configuration instructions
|
||||
| LaTeX | [chktex](http://www.nongnu.org/chktex/), [lacheck](https://www.ctan.org/pkg/lacheck), [proselint](http://proselint.com/) |
|
||||
|
@ -12,6 +12,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['python'],
|
||||
\ 'description': 'Fix PEP8 issues with autopep8.',
|
||||
\ },
|
||||
\ 'prettier_standard': {
|
||||
\ 'function': 'ale#fixers#prettier_standard#Fix',
|
||||
\ 'suggested_filetypes': ['javascript'],
|
||||
\ 'description': 'Apply prettier-standard to a file.',
|
||||
\ },
|
||||
\ 'eslint': {
|
||||
\ 'function': 'ale#fixers#eslint#Fix',
|
||||
\ 'suggested_filetypes': ['javascript', 'typescript'],
|
||||
|
24
autoload/ale/fixers/prettier_standard.vim
Normal file
24
autoload/ale/fixers/prettier_standard.vim
Normal file
@ -0,0 +1,24 @@
|
||||
" Author: sheerun (Adam Stankiewicz) <sheerun@sher.pl>
|
||||
" Description: Integration of Prettier Standard with ALE.
|
||||
|
||||
call ale#Set('javascript_prettier_standard_executable', 'prettier-standard')
|
||||
call ale#Set('javascript_prettier_standard_use_global', 0)
|
||||
call ale#Set('javascript_prettier_standard_options', '')
|
||||
|
||||
function! ale#fixers#prettier_standard#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'javascript_prettier_standard', [
|
||||
\ 'node_modules/prettier-standard/lib/index.js',
|
||||
\ 'node_modules/.bin/prettier-standard',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#prettier_standard#Fix(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'javascript_prettier_standard_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(ale#fixers#prettier_standard#GetExecutable(a:buffer))
|
||||
\ . ' %t'
|
||||
\ . ' ' . l:options,
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
@ -118,6 +118,37 @@ g:ale_javascript_prettier_eslint_use_global
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
prettier-standard *ale-javascript-prettier-eslint*
|
||||
|
||||
|
||||
g:ale_javascript_prettier_standard_executable
|
||||
*g:ale_javascript_prettier_eslint_executable*
|
||||
*b:ale_javascript_prettier_eslint_executable*
|
||||
Type: |String|
|
||||
Default: `'prettier-standard'`
|
||||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
|
||||
g:ale_javascript_prettier_standard_options
|
||||
*g:ale_javascript_prettier_standard_options*
|
||||
*b:ale_javascript_prettier_standard_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be set to pass additional options to prettier-standard.
|
||||
|
||||
|
||||
g:ale_javascript_prettier_standard_use_global
|
||||
*g:ale_javascript_prettier_standard_use_global*
|
||||
*b:ale_javascript_prettier_standard_use_global*
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
flow *ale-javascript-flow*
|
||||
|
||||
|
@ -53,6 +53,7 @@ CONTENTS *ale-contents*
|
||||
jshint..............................|ale-javascript-jshint|
|
||||
prettier............................|ale-javascript-prettier|
|
||||
prettier-eslint.....................|ale-javascript-prettier-eslint|
|
||||
prettier-standard...................|ale-javascript-prettier-standard|
|
||||
standard............................|ale-javascript-standard|
|
||||
xo..................................|ale-javascript-xo|
|
||||
kotlin................................|ale-kotlin-options|
|
||||
|
Loading…
Reference in New Issue
Block a user