Reputation: 105
All:
I'm having a problem.
I use syntastic for javascript syntax check. but quickfix is not working.
let g:syntastic_mode_map = { 'mode': 'active',
\ 'active_filetypes': ['python', 'javascript'],
\ 'passive_filetypes': [] }
let g:syntastic_auto_loc_list = 1 " 自动拉起窗口,不需要手动调用:Errors
let g:syntastic_check_on_open = 1 " 打开文件的时候检查
let g:syntastic_error_symbol = '✗' " 错误显示的字符
let g:syntastic_warning_symbol = '⚠' " 警告显示的字符
let g:go_list_type = "quickfix" " 选择quick'fix
let g:syntastic_check_on_wq = 0 " 保存退出时不检查语法
let g:syntastic_javascript_checkers = ['eslint']
let s:eslint_path =system('PATH=$(npm bin):$PATH && which eslint') "定义eslint_path变量
let b:syntastic_javascript_eslint_exec = substitute(s:eslint_path, '^\n*\s*\(.\{-}\)\n*\s*$', '\1', '')
when i use jslint has this:
npm install -g jslint
when i use eslint has this: npm install eslint -g and touch ~/.eslintrc give some options.
Where is the error. show E42: No Errors
Issuing cmd :SyntasticInfo
in buffer, I see:
Syntastic version: 3.7.0-180 (Vim 704, Darwin)
Info for filetype: javascript
Global mode: active
Filetype javascript is active
The current file will be checked automatically
Available checkers: eslint jshint jslint
Currently enabled checker: eslint
Upvotes: 2
Views: 2164
Reputation: 4494
For me, there was a need to do:
eslint --init
That generates an .eslintrc.js configuration file describing the rules to check for the specific project. Running eslint on the cli outside of vim gave the message for that need.
$ eslint test.js
Oops! Something went wrong! :(
ESLint couldn't find a configuration file. To set up a configuration file for this project, please run:
eslint --init
Upvotes: 2