]> git.immae.eu Git - github/fretlink/pronto-hlint.git/blame - README.md
use xenial on ci
[github/fretlink/pronto-hlint.git] / README.md
CommitLineData
5001cb27 1# Pronto runner for ESLint (using eslint from npm)
ce89f9ed 2
126fe1e2
MD
3[![Code Climate](https://codeclimate.com/github/doits/pronto-eslint_npm.svg)](https://codeclimate.com/github/doits/pronto-eslint_npm)
4[![Build Status](https://travis-ci.org/doits/pronto-eslint_npm.svg?branch=master)](https://travis-ci.org/doits/pronto-eslint_npm)
5[![Gem Version](https://badge.fury.io/rb/pronto-eslint_npm.svg)](http://badge.fury.io/rb/pronto-eslint_npm)
ce89f9ed
MM
6
7Pronto runner for [ESlint](http://eslint.org), pluggable linting utility for JavaScript and JSX. [What is Pronto?](https://github.com/mmozuras/pronto)
8
cf6aab4b 9Uses official eslint executable installed by `npm` in contrast to [pronto-eslint][pronto-eslint].
5001cb27 10
1d19d52c 11[pronto-eslint]: https://github.com/mmozuras/pronto-eslint
5001cb27 12
ce89f9ed
MM
13## Prerequisites
14
cf6aab4b 15You'll need to install [eslint by yourself with npm][eslint-install]. If `eslint` is in your `PATH`, everything will simply work, otherwise you have to provide pronto-eslint-npm your custom executable path (see [below](#configuration-of-eslintnpm)).
c2307793
MD
16
17[eslint-install]: http://eslint.org/docs/user-guide/getting-started
ce89f9ed 18
1845f2e3 19## Configuration of ESLint
ce89f9ed 20
cf6aab4b 21Configuring ESLint via [.eslintrc and consorts][eslintrc] and excludes via [.eslintignore][eslintignore] will work just fine with pronto-eslint-npm.
676cea90 22
c2307793 23[eslintrc]: http://eslint.org/docs/user-guide/configuring#configuration-file-formats
1845f2e3 24
676cea90 25[eslintignore]: http://eslint.org/docs/user-guide/configuring#ignoring-files-and-directories
1845f2e3
MD
26
27## Configuration of ESLintNPM
28
cf6aab4b 29pronto-eslint-npm can be configured by placing a `.pronto_eslint_npm.yml` inside the directory where pronto is run.
1845f2e3
MD
30
31Following options are available:
32
cf6aab4b
MD
33| Option | Meaning | Default |
34| ----------------- | ---------------------------------------------------------------------------------------- | ----------------------------------- |
35| eslint_executable | ESLint executable to call. | `eslint` (calls `eslint` in `PATH`) |
36| files_to_lint | What files to lint. Absolute path of offending file will be matched against this Regexp. | `(\.js|\.es6)$` |
12df00b5 37| cmd_line_opts | Command line options to pass to eslint when running | '' |
1845f2e3
MD
38
39Example configuration to call custom eslint executable and only lint files ending with `.my_custom_extension`:
40
41```yaml
94d658cd 42# .pronto_eslint_npm.yml
cf6aab4b 43eslint_executable: '/my/custom/node/path/.bin/eslint'
1845f2e3 44files_to_lint: '\.my_custom_extension$'
12df00b5 45cmd_line_opts: '--ext .html,.js,.es6'
1845f2e3 46```