-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add usage examples for gulp-eslint and webpack-eslint-loader #4
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,38 @@ 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'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove the |
||
); | ||
``` | ||
|
||
### [Webpack](https://github.com/webpack/webpack) - [eslint-loader](https://github.com/MoOx/eslint-loader) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Put webpack list in parens |
||
|
||
```js | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. spacing above here |
||
module.exports = { | ||
entry: 'example.js', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use |
||
output: { | ||
'dist', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is invalid JS There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry, fixed the props and tested each example once more |
||
filename: '[name].js' | ||
}, | ||
module: { | ||
loaders: [ | ||
{ test: /\.js$/, loader: 'eslint-loader' } | ||
] | ||
}, | ||
eslint: { | ||
formatter: require('eslint-formatter-pretty') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this actually work? The other examples requires relative path. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, have tested it since yesterday 😏 |
||
} | ||
}; | ||
``` | ||
|
||
## Tip | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spacing above here