Skip to content

Commit

Permalink
add usage examples for gulp-eslint and webpack-eslint-loader
Browse files Browse the repository at this point in the history
Examples for usage with gulp and webpack

Closes #4
  • Loading branch information
chrishelgert authored and sindresorhus committed Apr 22, 2016
1 parent 9922a22 commit b3dc768
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,41 @@ grunt.loadNpmTasks('grunt-eslint');
grunt.registerTask('default', ['eslint']);
```

### [gulp-eslint](https://github.com/adametry/gulp-eslint)

```js
const gulp = require('gulp');
const eslint = require('gulp-eslint');

gulp.task('lint', () =>
gulp.src('file.js')
.pipe(eslint())
.pipe(eslint.format('node_modules/eslint-formatter-pretty'))
);
```

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

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

## Tip

Expand Down

0 comments on commit b3dc768

Please sign in to comment.