1 | # rollup-plugin-eslint [![Travis Build Status][travis-img]][travis]
|
2 |
|
3 | [travis-img]: https://travis-ci.org/TrySound/rollup-plugin-eslint.svg
|
4 | [travis]: https://travis-ci.org/TrySound/rollup-plugin-eslint
|
5 | [rollup]: https://github.com/rollup/rollup
|
6 | [eslint-config]: http://eslint.org/docs/developer-guide/nodejs-api#cliengine
|
7 |
|
8 | [Rollup] plugin to verify entry point and all imported files with ESLint.
|
9 |
|
10 | ## Install
|
11 |
|
12 | ```sh
|
13 | yarn add rollup-plugin-eslint --dev
|
14 | ```
|
15 |
|
16 | ## Usage
|
17 |
|
18 | ```js
|
19 | import { rollup } from "rollup";
|
20 | import { eslint } from "rollup-plugin-eslint";
|
21 |
|
22 | export default {
|
23 | input: "main.js",
|
24 | plugins: [
|
25 | eslint({
|
26 | /* your options */
|
27 | })
|
28 | ]
|
29 | };
|
30 | ```
|
31 |
|
32 | ## Options
|
33 |
|
34 | See more options here [eslint-config].
|
35 |
|
36 | You can also use eslint configuration in the form of a `.eslintrc.*` file in your project's root. It will be loaded automatically.
|
37 |
|
38 | ### fix
|
39 |
|
40 | Type: `boolean`
|
41 | Default: `false`
|
42 |
|
43 | If true, will auto fix source code.
|
44 |
|
45 | ### throwOnError
|
46 |
|
47 | Type: `boolean`
|
48 | Default: `false`
|
49 |
|
50 | If true, will throw an error if any errors were found.
|
51 |
|
52 | ### throwOnWarning
|
53 |
|
54 | Type: `boolean`
|
55 | Default: `false`
|
56 |
|
57 | If true, will throw an error if any warnings were found.
|
58 |
|
59 | ### include
|
60 |
|
61 | Type: `array` or `string`
|
62 | Default: `[]`
|
63 |
|
64 | A single file, or array of files, to include when linting.
|
65 |
|
66 | ### exclude
|
67 |
|
68 | Type: `array` or `string`
|
69 | Default: `node_modules/**`
|
70 |
|
71 | A single file, or array of files, to exclude when linting.
|
72 |
|
73 | ### formatter
|
74 |
|
75 | Type: `function` or `string`
|
76 | Default: `stylish`
|
77 |
|
78 | Custom error formatter or the name of a built-in formatter.
|
79 |
|
80 | # License
|
81 |
|
82 | MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru)
|