Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/albertfdp/standard-react-loader
Lint webpack builds with feross/standard-react
https://github.com/albertfdp/standard-react-loader
Last synced: about 5 hours ago
JSON representation
Lint webpack builds with feross/standard-react
- Host: GitHub
- URL: https://github.com/albertfdp/standard-react-loader
- Owner: albertfdp
- License: other
- Created: 2016-04-15T21:01:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-04-15T21:13:11.000Z (over 8 years ago)
- Last Synced: 2024-07-09T13:14:51.194Z (4 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# standard-react-loader
webpack loader for linting your code with [feross/standard-react](https://github.com/feross/standard-react)
This loader is built on the existing [timoxley/standard-loader](https://github.com/timoxley/standard-loader) but uses standard-react so that you can get warnings for your React specific rules.
## Installation
```
npm install --save-dev standard-react-loader
```## Usage
```js
// webpack.config.js
const webpack = require('webpack')const config = {
// ...
module: {
preLoaders: [
{
// set up standard-loader as a preloader
test: /\.jsx?$/,
loader: 'standard-react',
exclude: /(node_modules|bower_components)/
}
],
loaders: [
// ...
]
},
standard: {
// config options to be passed through to standard e.g.
parser: 'babel-eslint'
}
}module.exports = config
```### Example Input
```js
//code not conforming to standard stylemodule.exports = function(a,b) {
console.log( a, b);
}```
### Example Output
```
> webpack
Hash: 757e85681387cfef939a
Version: webpack 1.9.11
Time: 1152ms
Asset Size Chunks Chunk Names
build.js 2.01 kB 0 [emitted] bundle
+ 1 hidden modulesWARNING in ./index.js
standard: Use JavaScript Standard Style (https://github.com/feross/standard):1:0: Expected space or tab after // in comment.
:3:25: Missing space before function parentheses.
:3:27: A space is required after ','.
:4:2: Expected indentation of 2 characters.
:4:15: There should be no spaces inside this paren.
:4:23: Extra semicolon.
:7:0: Multiple blank lines not allowed.
```## Licence
MIT