Vue.js checkers: cleanup.

This commit is contained in:
LCD 47 2017-09-02 07:41:39 +03:00
parent 281a6df78e
commit 0858da63ec
6 changed files with 86 additions and 24 deletions

View File

@ -61,16 +61,16 @@ Source Language, ActionScript, Ada, Ansible configurations, API Blueprint,
AppleScript, AsciiDoc, Assembly languages, BEMHTML, Bro, Bourne shell, C, C++, AppleScript, AsciiDoc, Assembly languages, BEMHTML, Bro, Bourne shell, C, C++,
C#, Cabal, Chef, CMake, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, C#, Cabal, Chef, CMake, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart,
DocBook, Dockerfile, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata, DocBook, Dockerfile, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata,
GLSL, Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, GLSL, Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript,
JSX, Julia, LESS, Lex, Limbo, LISP, LLVM intermediate language, Lua, Markdown, JSON, JSX, Julia, LESS, Lex, Limbo, LISP, LLVM intermediate language, Lua,
MATLAB, Mercury, NASM, Nix, Objective-C, Objective-C++, OCaml, Perl, Perl POD, Markdown, MATLAB, Mercury, NASM, Nix, Objective-C, Objective-C++, OCaml, Perl,
PHP, gettext Portable Object, OS X and iOS property lists, Pug (formerly Jade), Perl POD, PHP, gettext Portable Object, OS X and iOS property lists, Pug
Puppet, Python, QML, R, Racket, RDF TriG, RDF Turtle, Relax NG, (formerly Jade), Puppet, Python, QML, R, Racket, RDF TriG, RDF Turtle, Relax
reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Solidity, Sphinx, NG, reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Solidity,
SQL, Stylus, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, Vim help, Sphinx, SQL, Stylus, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL,
VimL, Vue.js, xHtml, XML, XSLT, XQuery, YACC, YAML, YANG data models, z80, Vim help, VimL, Vue.js, xHtml, XML, XSLT, XQuery, YACC, YAML, YANG data models,
Zope page templates, and Zsh. See the [manual][checkers] for details about the z80, Zope page templates, and Zsh. See the [manual][checkers] for details about
corresponding supported checkers (`:help syntastic-checkers` in Vim). the corresponding supported checkers (`:help syntastic-checkers` in Vim).
A number of third-party Vim plugins also provide checkers for syntastic, for A number of third-party Vim plugins also provide checkers for syntastic, for
example: [merlin][merlin], [omnisharp-vim][omnisharp], [rust.vim][rust], example: [merlin][merlin], [omnisharp-vim][omnisharp], [rust.vim][rust],

View File

@ -2868,7 +2868,8 @@ to it:
https://github.com/mantoni/eslint_d.js#editor-integration https://github.com/mantoni/eslint_d.js#editor-integration
See also: |syntastic-javascript-eslint|, |syntastic-typescript-eslint|. See also: |syntastic-javascript-eslint|, |syntastic-typescript-eslint|,
|syntastic-vue-eslint|.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2. gjslint *syntastic-html-gjslint* 2. gjslint *syntastic-html-gjslint*
@ -3426,7 +3427,8 @@ version 2.1.0 or later, instead of "ESLint". Just point
https://github.com/mantoni/eslint_d.js#editor-integration https://github.com/mantoni/eslint_d.js#editor-integration
See also: |syntastic-html-eslint|, |syntastic-typescript-eslint|. See also: |syntastic-html-eslint|, |syntastic-typescript-eslint|,
|syntastic-vue-eslint|.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
3. Flow *syntastic-javascript-flow* 3. Flow *syntastic-javascript-flow*
@ -6737,7 +6739,8 @@ as "typescript-vim":
https://github.com/leafgarland/typescript-vim https://github.com/leafgarland/typescript-vim
See also: |syntastic-html-eslint|, |syntastic-javascript-eslint|. See also: |syntastic-html-eslint|, |syntastic-javascript-eslint|,
|syntastic-vue-eslint|.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2. TSLint *syntastic-typescript-tslint* 2. TSLint *syntastic-typescript-tslint*
@ -7042,10 +7045,41 @@ SYNTAX CHECKERS FOR VUE.JS *syntastic-checkers-vue*
The following checkers are available for Vue.js (filetype "vue"): The following checkers are available for Vue.js (filetype "vue"):
1. pug_lint_vue..............|syntastic-vue-pug_lint_vue| 1. ESLint...................|syntastic-vue-eslint|
2. pug_lint_vue.............|syntastic-vue-pug_lint_vue|
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
1. pug_lint_vue *syntastic-vue-pug_lint_vue* 1. ESLint *syntastic-vue-eslint*
Name: eslint
Maintainer: LCD 47 <lcd047@gmail.com>
"ESLint" is a tool for identifying and reporting on patterns found in
ECMAScript/JavaScript code. It can also detect problems in JavaScript
components of Vue.js files. See the project's page for details:
https://github.com/nzakas/eslint
Checker options~
This checker is initialised using the "makeprgBuild()" function and thus it
accepts the standard options described at |syntastic-config-makeprg|.
Notes~
Automatically fixing errors (option "--fix") is not supported.
You can also use "eslint_d" (https://github.com/mantoni/eslint_d.js), version
2.1.0 or later, instead of "ESLint". Just point 'g:syntastic_vue_eslint_exec'
to it:
https://github.com/mantoni/eslint_d.js#editor-integration
See also: |syntastic-html-eslint|, |syntastic-javascript-eslint|,
|syntastic-typescript-eslint|.
------------------------------------------------------------------------------
2. pug_lint_vue *syntastic-vue-pug_lint_vue*
Name: pug_lint_vue Name: pug_lint_vue
Maintainer: Tim Carry <tim@pixelastic.com> Maintainer: Tim Carry <tim@pixelastic.com>
@ -7065,6 +7099,13 @@ Checker options~
This checker is initialised using the "makeprgBuild()" function and thus it This checker is initialised using the "makeprgBuild()" function and thus it
accepts the standard options described at |syntastic-config-makeprg|. accepts the standard options described at |syntastic-config-makeprg|.
Note~
You probably also need a plugin to set |filetype| for Vue.js files, such as
"vim-vue":
https://github.com/posva/vim-vue
============================================================================== ==============================================================================
SYNTAX CHECKERS FOR XHTML *syntastic-checkers-xhtml* SYNTAX CHECKERS FOR XHTML *syntastic-checkers-xhtml*

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START lockvar! g:_SYNTASTIC_START
endif endif
let g:_SYNTASTIC_VERSION = '3.8.0-71' let g:_SYNTASTIC_VERSION = '3.8.0-73'
lockvar g:_SYNTASTIC_VERSION lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1 " Sanity checks {{{1

View File

@ -103,7 +103,7 @@ let s:_DEFAULT_CHECKERS = {
\ 'verilog': ['verilator'], \ 'verilog': ['verilator'],
\ 'vhdl': ['ghdl'], \ 'vhdl': ['ghdl'],
\ 'vim': ['vimlint'], \ 'vim': ['vimlint'],
\ 'vue': ['pug_lint_vue'], \ 'vue': ['pug_lint_vue', 'eslint'],
\ 'xhtml': ['tidy'], \ 'xhtml': ['tidy'],
\ 'xml': ['xmllint'], \ 'xml': ['xmllint'],
\ 'xslt': ['xmllint'], \ 'xslt': ['xmllint'],

View File

@ -0,0 +1,23 @@
"============================================================================
"File: eslint.vim
"Description: Syntax checking plugin for syntastic
"Maintainer: LCD 47 <lcd047 at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_vue_eslint_checker')
finish
endif
let g:loaded_syntastic_vue_eslint_checker = 1
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'vue',
\ 'name': 'eslint',
\ 'redirect': 'javascript/eslint'})
" vim: set sw=4 sts=4 et fdm=marker:

View File

@ -1,6 +1,6 @@
"============================================================================ "============================================================================
"File: pug_lint_vue.vim "File: pug_lint_vue.vim
"Description: Syntax checking plugin for syntastic.vim using pug-lint-vue "Description: Syntax checking plugin for syntastic using pug-lint-vue
" (https://github.com/sourceboat/pug-lint-vue) " (https://github.com/sourceboat/pug-lint-vue)
"Maintainer: Tim Carry <tim at pixelastic dot com> "Maintainer: Tim Carry <tim at pixelastic dot com>
"License: This program is free software. It comes without any warranty, "License: This program is free software. It comes without any warranty,
@ -20,17 +20,15 @@ let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_vue_pug_lint_vue_GetLocList() dict function! SyntaxCheckers_vue_pug_lint_vue_GetLocList() dict
let makeprg = self.makeprgBuild({ 'fname': expand('%:p') }) let buf = bufnr('')
let makeprg = self.makeprgBuild({ 'fname': syntastic#util#shescape(fnamemodify(bufname(buf), ':p')) })
let errorformat = ' %l:%c %m' let errorformat = '%\s%#%l:%c %m'
return SyntasticMake({ return SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'defaults': { \ 'defaults': { 'bufnr': buf, 'type': 'E' } })
\ 'bufnr': bufnr(''),
\ 'type': 'E'
\ } })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({