1313
1414# eslint-webpack-plugin
1515
16- > A ESLint plugin for webpack
16+ This plugin uses [ ` eslint ` ] ( https://eslint.org/ ) to find and fix problems in your JavaScript code
1717
18- ## About plugin
18+ ## Getting Started
1919
20- The plugin was born with the purpose of solving some problems of the [ eslint-loader] ( https://github.com/webpack-contrib/eslint-loader ) .
21-
22- | | eslint-webpack-plugin | eslint-loader |
23- | -------------------------------- | :-------------------: | :----------------------: |
24- | Easy configuration | :heavy_check_mark : | :heavy_multiplication_x : |
25- | Generate unique an output report | :heavy_check_mark : | :heavy_multiplication_x : |
26- | Using cache directly from eslint | :heavy_check_mark : | :heavy_multiplication_x : |
27- | Lint only changed files | :heavy_check_mark : | :heavy_multiplication_x : |
28-
29- ## Migrate from ` eslint-loader `
30-
31- The loader ` eslint-loader ` will be deprecated soon, please use this plugin instead.
32-
33- Before:
34-
35- ``` js
36- module .exports = {
37- // ...
38- module: {
39- rules: [
40- {
41- test: / \. js$ / ,
42- exclude: / node_modules/ ,
43- loader: ' eslint-loader' ,
44- options: {
45- // eslint options (if necessary)
46- },
47- },
48- ],
49- },
50- // ...
51- };
52- ```
53-
54- After:
55-
56- ``` js
57- const ESLintPlugin = require (' eslint-webpack-plugin' );
58-
59- module .exports = {
60- // ...
61- plugins: [new ESLintPlugin (options)],
62- // ...
63- };
64- ```
65-
66- ## Install
20+ To begin, you'll need to install ` eslint-webpack-plugin ` :
6721
6822``` bash
6923npm install eslint-webpack-plugin --save-dev
@@ -75,9 +29,7 @@ npm install eslint-webpack-plugin --save-dev
7529npm install eslint --save-dev
7630```
7731
78- ## Usage
79-
80- In your webpack configuration:
32+ Then add the plugin to your webpack config. For example:
8133
8234``` js
8335const ESLintPlugin = require (' eslint-webpack-plugin' );
0 commit comments