Eslint opinionated configuration for react projects, that use:
- React with hooks or are in process of refactoring to hooks
- Typescript
- React Query for data fetching
- Recoil as state management library
- Jest with Testing library for unit, integration testing and UI interaction testing
It also contains configuration for Prettier
and Typescript
.
- If you don't have ESLint yet configured for your project, follow these instructions.
- Install
eslint-plugin-sandokan
usingnpm
(oryarn
) for you project or globally:
npm install eslint-plugin-sandokan --save-dev # install for your project
npm install eslint-plugin-sandokan -g # or install globally
- Add
sandokan
to theextends
option to enable all recommended rules:
{
"extends": ["sandokan"]
}
To use the shared Prettier config, set the following in .prettierrc.yaml
:
'eslint-config-sandokan/prettier'
To use the shared TypeScript config, set the following in tsconfig.json
.
{
"extends": "eslint-config-sandokan/typescript"
}
The configuration is made for Jest and Testing Library.
it is applied to all files that ends with .test.
or .spec.
.
- unicorn/filename-case