eslint-formatter-vim icon indicating copy to clipboard operation
eslint-formatter-vim copied to clipboard

An eslint formatter that plays nicely in vim

eslint-formatter-vim

an ESlint Formatter that works well with the native vim errorformat conventions

Install

npm i --save-dev eslint-formatter-vim

Usage

set the makeprg for javascript files to use eslint, with the formatter

autocmd FileType javascript setlocal makeprg=eslint\ --format=node_modules/eslint-formatter-vim

from within vim, use make

:make! %

output should look like:

ERROR: eslint/js-sample.js:1:10 - 'foo' is defined but never used.

Tips

This formatter is meant to help those who want a lightweight solution to linting javscript when using vim. If you're into that, you should check out this gist