UNPKG

1.58 kBMarkdownView Raw
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
13yarn add rollup-plugin-eslint --dev
14```
15
16## Usage
17
18```js
19import { rollup } from "rollup";
20import { eslint } from "rollup-plugin-eslint";
21
22export default {
23 input: "main.js",
24 plugins: [
25 eslint({
26 /* your options */
27 })
28 ]
29};
30```
31
32## Options
33
34See more options here [eslint-config].
35
36You 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
40Type: `boolean`
41Default: `false`
42
43If true, will auto fix source code.
44
45### throwOnError
46
47Type: `boolean`
48Default: `false`
49
50If true, will throw an error if any errors were found.
51
52### throwOnWarning
53
54Type: `boolean`
55Default: `false`
56
57If true, will throw an error if any warnings were found.
58
59### include
60
61Type: `array` or `string`
62Default: `[]`
63
64A single file, or array of files, to include when linting.
65
66### exclude
67
68Type: `array` or `string`
69Default: `node_modules/**`
70
71A single file, or array of files, to exclude when linting.
72
73### formatter
74
75Type: `function` or `string`
76Default: `stylish`
77
78Custom error formatter or the name of a built-in formatter.
79
80# License
81
82MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru)