Skip to content

Commit

Permalink
Simplify readme instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Nov 16, 2017
1 parent e3e80c1 commit 1e0d92e
Showing 1 changed file with 10 additions and 45 deletions.
55 changes: 10 additions & 45 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ $ npm install --save-dev eslint-formatter-pretty
### ESLint CLI

```
$ eslint --format=node_modules/eslint-formatter-pretty file.js
$ eslint --format=pretty file.js
```

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

```js
grunt.initConfig({
eslint: {
target: ['file.js'].
options: {
format: 'node_modules/eslint-formatter-pretty'
},
target: ['file.js']
format: 'pretty'
}
}
});

Expand All @@ -45,62 +45,27 @@ const eslint = require('gulp-eslint');
gulp.task('lint', () =>
gulp.src('file.js')
.pipe(eslint())
.pipe(eslint.format('node_modules/eslint-formatter-pretty'))
.pipe(eslint.format('pretty'))
);
```

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

#### webpack v1

```js
module.exports = {
entry: ['file.js'],
output: {
path: 'dist',
filename: '[name].js'
},
module: {
preLoaders: [
{
test: /\.js$/,
loader: 'eslint-loader',
exclude: /node_modules/
}
]
},
eslint: {
formatter: require('eslint-formatter-pretty')
}
};
```

#### webpack v2

```js
module.exports = {
entry: ['file.js'],
output: {
path: 'dist',
filename: '[name].js'
},
module: {
rules: [
{
test: /\.js$/,
loader: 'eslint-loader'
}
]
},
plugins: [
new webpack.LoaderOptionsPlugin({
options: {
eslint: {
exclude: /node_modules/,
loader: 'eslint-loader',
options: {
formatter: require('eslint-formatter-pretty')
}
}
})
]
]
}
};
```

Expand Down

0 comments on commit 1e0d92e

Please sign in to comment.