Neutrino preset for react project adding xo's base JS ESLint config, following the xo styleguide
# yarn
$ yarn add --dev neutrino-preset-eslint-react
# npm
$ npm install --save-dev neutrino-preset-eslint-react
After adding the eslint react preset to your Neutrino-built project, edit your project's package.json to add the preset for
linting before your build preset. For example, if you are building your project using neutrino-preset-react
:
{
"scripts": {
"start": "neutrino start --use neutrino-preset-eslint-react neutrino-preset-react",
"build": "neutrino build --use neutrino-preset-eslint-react neutrino-preset-react"
}
}
Or if you are using a .neutrinorc.js
, add this preset to your use array instead of --use
flags:
module.exports = {
use: [
'neutrino-preset-eslint-react',
'neutrino-preset-react'
]
};
This preset uses the same middleware options as neutrino-middleware-eslint. If you wish to customize what is included, excluded, or any ESLint options, you can provide an options object with the middleware and this will be merged with our internal defaults for this preset. Use an array pair instead of a string to supply these options.
module.exports = {
use: [
['neutrino-preset-eslint-react', {
eslint: {
rules: {
semi: ['error', 'always']
}
}
}]
]
}
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
neutrino-preset-eslint-react © zcong1993, Released under the MIT License.
Authored and maintained by zcong1993 with help from contributors (list).
github.com/zcong1993 · GitHub @zcong1993