https://github.com/hearthsim/eslint-config-typescript-react
HearthSim's common ESLint configuration with React support
https://github.com/hearthsim/eslint-config-typescript-react
Last synced: 3 months ago
JSON representation
HearthSim's common ESLint configuration with React support
- Host: GitHub
- URL: https://github.com/hearthsim/eslint-config-typescript-react
- Owner: HearthSim
- License: isc
- Created: 2022-06-14T11:07:41.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-27T16:39:15.000Z (over 2 years ago)
- Last Synced: 2025-01-31T20:54:09.716Z (over 1 year ago)
- Language: JavaScript
- Size: 26.4 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @hearthsim/eslint-config-typescript-react
This repository contains the HearthSim common ESLint configuration with Typescript and React support.
For a version **without** React support use [@HearthSim/eslint-config-typescript](https://github.com/HearthSim/eslint-config-typescript) instead.
## Setup
1. Install
```bash
$ yarn add -D eslint @hearthsim/eslint-config-typescript-react
```
2. Install ESLint plugins
Plugins are resolved relative to the final project and must thus installed explicitly as part of the project:
```bash
$ yarn add -D \
@typescript-eslint/eslint-plugin@^5.4.0 \
eslint-plugin-import@2.25.3 \
eslint-plugin-jest@25.2.4 \
eslint-plugin-react@7.27.1 \
eslint-plugin-react-hooks@4.3.0
```
3. Configure ESLint:
Create or update your`.eslintrc.js`:
```js
module.exports = {
root: true,
extends: ["@hearthsim/eslint-config-typescript-react"],
env: {
browser: true,
},
};
```
4. Add the scripts to your `package.json`:
```json
{
"scripts": {
"lint:eslint": "eslint --cache ./"
}
}
```
## Philosophy
### Zero tolerance for Errors false positives
If a rule is not able to handle the ways we legitimately use it, it needs to be downgraded to a warning.
Errors are reserved for critical issues that can directly introduce security risks, break the application or lead to severe performance penalties.