1.4.0 • Published 6 years ago
eslint-plugin-m6web-tools v1.4.0
Eslint-plugin-m6web-tools
The purpose of this package is simple, simplify the configuration of eslint and prettier in our projects.
It provides:
- eslint-config-m6web which inherits from eslint-config-airbnb
- eslint itself
- prettier with all the plugins needed to work with eslint
With that come some little changes from the default config of eslint-config-airbnb and prettier that you can find in index.js file and here.
Setup
npm install --dev eslint-plugin-m6web-tools
or
yarn add --dev eslint-plugin-m6web-tools
Then you need to add the plugin in the .eslintrc
file of your project. For that create a .eslintrc
and add the following lines:
"extends": "plugin:m6web-tools/m6web",
"plugins": [
"m6web-tools"
],
And that's all.
If you want to customize some rules, follow the eslint documentation.
Jest / Jasmine Support
If you want, you can add the jest support with the following lines:
{
"env": {
"browser": true,
"jasmine": true
}
}
Usage
Lint your code:
yarn eslint src/
Rewrite your code, the right way :smiling_imp::
yarn prettier-eslint -- --write 'src/**/*.js'