1.1.0 • Published 10 years ago
generator-eslint-init v1.1.0
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-initUsage
# 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-existsComposability
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-initCompose
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
- extend existing eslint config, and do not overwrite it
- ability to specify versions to not depend on network to extend
package.jsondevDependencies section - let to save in different locations:
package.json,.eslintrc.ymlor.eslintrc.js, not only in.eslintrc.json
Pull-requests are very welcome.
License
MIT © Vladimir Starkov