eslint-config-kyt
Installation
yarn
$ yarn add --dev --exact @babel/core @babel/eslint-parser @babel/eslint-plugin eslint prettier \
eslint-config-airbnb eslint-config-prettier eslint-plugin-import \
eslint-plugin-jest eslint-plugin-jest-formatting \
eslint-plugin-json eslint-plugin-jsx-a11y eslint-plugin-prettier \
eslint-plugin-react eslint-plugin-react-hooks eslint-config-kyt
$ npm i --save-dev --save-exact @babel/core @babel/eslint-parser @babel/eslint-plugin eslint prettier \
eslint-config-airbnb eslint-config-prettier eslint-plugin-import \
eslint-plugin-jest eslint-plugin-jest-formatting \
eslint-plugin-json eslint-plugin-jsx-a11y eslint-plugin-prettier \
eslint-plugin-react eslint-plugin-react-hooks eslint-config-kyt
Add to the extends
section of your ESLint configuration:
.eslintrc(.json)
:
{
"extends": ["kyt"],
"rules": {}
}
.eslintrc.js
:
module.exports = {
extends: ['kyt'],
rules: {
},
};
To add a subset of rules, you can specify one of the following:
module.exports = {
extends: [
'kyt/base',
'kyt/jest',
'kyt/react',
'kyt',
],
};
Prettier Support
yarn eslint . --fix
Or add to your package.json
:
{
"scripts": {
"lint": "eslint .",
"lint-fix": "eslint . --fix"
}
}
Editor Configuration
To automatically format your code based on these rules during development, install a package for your IDE. We recommend that you install and configure ESLint with one of the following editors:
VSCode
- go to View > Extensions
- Install
ESLint
- Install
Prettier
- Go to
Code > Preferences
- Change the following preferences to
true
:
"prettier.eslintIntegration": true,
"editor.formatOnSave": true
Atom
- Go to
Preferences > Install
- Install
linter
- Install
linter-eslint
- Install
prettier-atom
. In the prettier-atom
settings, check the ESLint Integration
checkbox. - Make sure all packages are enabled. You may need to restart Atom.