generator-eslint-init
v1.1.0
Published
Yeoman generator to get eslint up and running in your project with your favorite preset (and with plugins if you want)
Downloads
16
Maintainers
Readme
generator-eslint-init
Yeoman generator to get eslint up and running in your project with your favorite preset (and with plugins if you want)
Install
npm install --global yo generator-eslint-init
Usage
# nope, it will do nothing, just install eslint and babel-eslint into your project
yo eslint-init
# install eslint with your favorite preset
yo eslint-init airbnb
# another one
yo eslint-init airbnb/legacy
# even with plugins
yo eslint-init airbnb --plugins react
yo eslint-init airbnb --plugins react,require-path-exists
# and short notation
yo eslint-init airbnb -p react,require-path-exists
Composability
Composability is a way to combine smaller parts to make one large thing. Sort of like Voltron®
— Yeoman docs
Just plug in eslint-init into your generator and let it setup your .eslintrc.json
and install required devDependencies
for you. Everybody wins.
Install
npm install --save generator-eslint-init
Compose
The whole options.config
will be saved into .eslintrc.json
. Items from extends
and plugins
fields will be installed as devDependencies
into your project with proper package names.
this.composeWith('eslint-init', { options: {
'skip-install': this.options['skip-install'],
config: {
extends: 'airbnb',
plugins: ['require-path-exists']
}
}}, {
local: require.resolve('generator-eslint-init')
});
Improvements / Contributing
- [x] extend existing eslint config, and do not overwrite it
- [ ] ability to specify versions to not depend on network to extend
package.json
devDependencies section - [ ] let to save in different locations:
package.json
,.eslintrc.yml
or.eslintrc.js
, not only in.eslintrc.json
Pull-requests are very welcome.
License
MIT © Vladimir Starkov