-
Notifications
You must be signed in to change notification settings - Fork 94
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
Support for ESLint #254
Support for ESLint #254
Changes from 4 commits
0c0174c
c6f2633
00a57f3
be04c61
6194468
f71da4a
bf76e89
ca6f458
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# @webpack-blocks/eslint - Changelog | ||
|
||
## Next release | ||
|
||
Initial release. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# webpack-blocks - TSLint | ||
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. Copy 🍝 - needs to be 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. Oh, thanks :) These packages are very similar, so I've decided to copy files from the 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. Sure, that's how I would have done as well 😉 |
||
|
||
[![Gitter chat](https://badges.gitter.im/webpack-blocks.svg)](https://gitter.im/webpack-blocks) | ||
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) | ||
[![NPM Version](https://img.shields.io/npm/v/@webpack-blocks/eslint.svg)](https://www.npmjs.com/package/@webpack-blocks/eslint) | ||
|
||
This is the `eslint` block providing JavaScript linting support for webpack. Uses `eslint` via `eslint-loader`. | ||
|
||
|
||
## Usage | ||
|
||
```js | ||
const { createConfig } = require('@webpack-blocks/webpack') | ||
const eslint = require('@webpack-blocks/eslint') | ||
|
||
module.exports = createConfig([ | ||
eslint(/* eslint options */) | ||
]) | ||
``` | ||
|
||
Use `match()` to explicitly specify the files to lint. | ||
|
||
|
||
## Options | ||
|
||
You can pass any `eslint-loader` options as an object to the `eslint` block. See [eslint-loader options](https://github.com/webpack-contrib/eslint-loader#options). | ||
|
||
|
||
## webpack-blocks | ||
|
||
Check out the | ||
|
||
👉 [Main documentation](https://github.com/andywer/webpack-blocks) | ||
|
||
Released under the terms of the MIT license. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* ESLint webpack block. | ||
* | ||
* @see https://github.com/webpack-contrib/eslint-loader | ||
*/ | ||
|
||
module.exports = eslint | ||
|
||
/** | ||
* @param {object} [options] See https://github.com/webpack-contrib/eslint-loader#options | ||
* @return {Function} | ||
*/ | ||
function eslint (options = {}) { | ||
return (context, util) => | ||
util.addLoader( | ||
Object.assign( | ||
{ | ||
test: /\.(js|jsx)$/, | ||
use: ['eslint-loader'], | ||
enforce: 'pre', | ||
options | ||
}, | ||
context.match | ||
) | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "@webpack-blocks/eslint", | ||
"version": "1.0.0-rc", | ||
"description": "Webpack block for JavaScript linting.", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"author": "Dmytro Meleshko <dmytro.meleshko@gmail.com>", | ||
"scripts": { | ||
"test": "standard", | ||
"prepublishOnly": "npm test" | ||
}, | ||
"engines": { | ||
"node": ">= 6.0" | ||
}, | ||
"keywords": [ | ||
"webpack", | ||
"webpack-blocks" | ||
], | ||
"repository": "andywer/webpack-blocks", | ||
"bugs": "https://github.com/andywer/webpack-blocks/issues", | ||
"dependencies": { | ||
"eslint-loader": "^1.9.0" | ||
}, | ||
"peerDependencies": { | ||
"@webpack-blocks/core": "^1.0.0-rc" | ||
} | ||
} |
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.
In this case we can enter the version number already, since we will publish right away.