A shared eslint config for WPQuark projects. It uses both eslint and prettier for auto-fixable codes along with linting.
Add to project's devDependency
.
yarn add @wpquark/eslint-config eslint prettier --dev
Now create a .eslintrc
file in the root of your project and put the code.
{
"extends": "@wpquark"
}
You can also extend upon the rules.
Create a prettier.config.js
file in the root of your project and put the code.
const config = require('@wpquark/eslint-config/prettier.config.js');
module.exports = config;
Now you are ready to go.
Install the eslint
plugin for VSCode. Enable autoFormat for javascript
and javascriptreact
files.
- Go to Code > Preference [File > Preference for Windows & Linux].
- Edit the WorkSpace Settings (Recommended).
{
"eslint.autoFixOnSave": true,
"[javascript]": {
"editor.formatOnSave": false
},
"[javascriptreact]": {
"editor.formatOnSave": false
}
}
- Upgrade dependencies to latest.
- Add eslint-plugin-babel to the mix.
- Upgrade dependencies to latest.
- Now airbnb eslint config supports eslint
^5.3.0
.
- Breaking: prettier is now a peerDependency.
- Upgrade
babel-eslint
parser to9.x-beta
. - Upgrade other packages to latest stable.
- Initial Release.