File tree 1 file changed +10
-45
lines changed
1 file changed +10
-45
lines changed Original file line number Diff line number Diff line change @@ -17,18 +17,18 @@ $ npm install --save-dev eslint-formatter-pretty
17
17
### ESLint CLI
18
18
19
19
```
20
- $ eslint --format=node_modules/eslint-formatter- pretty file.js
20
+ $ eslint --format=pretty file.js
21
21
```
22
22
23
23
### [ grunt-eslint] ( https://github.com/sindresorhus/grunt-eslint )
24
24
25
25
``` js
26
26
grunt .initConfig ({
27
27
eslint: {
28
+ target: [' file.js' ].
28
29
options: {
29
- format: ' node_modules/eslint-formatter-pretty'
30
- },
31
- target: [' file.js' ]
30
+ format: ' pretty'
31
+ }
32
32
}
33
33
});
34
34
@@ -45,62 +45,27 @@ const eslint = require('gulp-eslint');
45
45
gulp .task (' lint' , () =>
46
46
gulp .src (' file.js' )
47
47
.pipe (eslint ())
48
- .pipe (eslint .format (' node_modules/eslint-formatter- pretty' ))
48
+ .pipe (eslint .format (' pretty' ))
49
49
);
50
50
```
51
51
52
52
### [ eslint-loader] ( https://github.com/MoOx/eslint-loader ) * (webpack)*
53
53
54
- #### webpack v1
55
-
56
54
``` js
57
55
module .exports = {
58
56
entry: [' file.js' ],
59
- output: {
60
- path: ' dist' ,
61
- filename: ' [name].js'
62
- },
63
- module: {
64
- preLoaders: [
65
- {
66
- test: / \. js$ / ,
67
- loader: ' eslint-loader' ,
68
- exclude: / node_modules/
69
- }
70
- ]
71
- },
72
- eslint: {
73
- formatter: require (' eslint-formatter-pretty' )
74
- }
75
- };
76
- ```
77
-
78
- #### webpack v2
79
-
80
- ``` js
81
- module .exports = {
82
- entry: [' file.js' ],
83
- output: {
84
- path: ' dist' ,
85
- filename: ' [name].js'
86
- },
87
57
module: {
88
58
rules: [
89
59
{
90
60
test: / \. js$ / ,
91
- loader: ' eslint-loader'
92
- }
93
- ]
94
- },
95
- plugins: [
96
- new webpack.LoaderOptionsPlugin ({
97
- options: {
98
- eslint: {
61
+ exclude: / node_modules/ ,
62
+ loader: ' eslint-loader' ,
63
+ options: {
99
64
formatter: require (' eslint-formatter-pretty' )
100
65
}
101
66
}
102
- })
103
- ]
67
+ ]
68
+ }
104
69
};
105
70
```
106
71
You can’t perform that action at this time.
0 commit comments