My own ESLint configuration rules collected from all corners of the universe. 🚀
This configuration uses prettier
for code formatting and contains React&ECMAScript 6+ best practices, possible errors, stylistic issues, etc. It requires some dependencies for advanced ESLint setup:
- eslint
- prettier
- eslint-config-prettier
- eslint-plugin-prettier
- eslint-plugin-import
- eslint-plugin-react
- eslint-plugin-flowtype (optional)
- Install each package specified in peer dependencies, using this command:
$ yarn add --dev eslint prettier eslint-config-zalishchuk eslint-config-prettier eslint-plugin-prettier eslint-plugin-import eslint-plugin-react
Or if you are using npm:
$ npm install --save-dev eslint prettier eslint-config-zalishchuk eslint-config-prettier eslint-plugin-prettier eslint-plugin-import eslint-plugin-react
- Add
eslint-config-zalishchuk
to your ESLint configuration extends section.
{
"extends": "zalishchuk"
}
- Install
eslint-plugin-flowtype
andbabel-eslint
packages, using this command:
$ yarn add --dev eslint-plugin-flowtype babel-eslint
Or if you are using npm:
$ npm install --save-dev eslint-plugin-flowtype babel-eslint
- Add
zalishchuk/flowtype
shareable configuration and setparser
tobabel-eslint
in your ESLint configuration file.
{
"parser": "babel-eslint",
"extends": ["zalishchuk", "zalishchuk/flowtype"]
}