Skip to content

Commit 1e0d92e

Browse files
authored
1 parent e3e80c1 commit 1e0d92e

File tree

1 file changed

+10
-45
lines changed

1 file changed

+10
-45
lines changed

readme.md

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ $ npm install --save-dev eslint-formatter-pretty
1717
### ESLint CLI
1818

1919
```
20-
$ eslint --format=node_modules/eslint-formatter-pretty file.js
20+
$ eslint --format=pretty file.js
2121
```
2222

2323
### [grunt-eslint](https://github.com/sindresorhus/grunt-eslint)
2424

2525
```js
2626
grunt.initConfig({
2727
eslint: {
28+
target: ['file.js'].
2829
options: {
29-
format: 'node_modules/eslint-formatter-pretty'
30-
},
31-
target: ['file.js']
30+
format: 'pretty'
31+
}
3232
}
3333
});
3434

@@ -45,62 +45,27 @@ const eslint = require('gulp-eslint');
4545
gulp.task('lint', () =>
4646
gulp.src('file.js')
4747
.pipe(eslint())
48-
.pipe(eslint.format('node_modules/eslint-formatter-pretty'))
48+
.pipe(eslint.format('pretty'))
4949
);
5050
```
5151

5252
### [eslint-loader](https://github.com/MoOx/eslint-loader) *(webpack)*
5353

54-
#### webpack v1
55-
5654
```js
5755
module.exports = {
5856
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-
},
8757
module: {
8858
rules: [
8959
{
9060
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: {
9964
formatter: require('eslint-formatter-pretty')
10065
}
10166
}
102-
})
103-
]
67+
]
68+
}
10469
};
10570
```
10671

0 commit comments

Comments
 (0)