eslint-config
My shared ESLint config.
Overview
This repository contains ESLint configurations for the following setups:
- TypeScript with React
They are designed to be used together with Prettier.
Usage
-
Install the required packages:
- TypeScript with React:
npm i -D @webbergreg/eslint-config \ @typescript-eslint/eslint-plugin \ @typescript-eslint/parser \ eslint \ eslint-config-prettier \ eslint-plugin-import \ eslint-plugin-prefer-arrow \ eslint-plugin-unused-imports
-
Create the following entry in your
package.json
file:- TypeScript with React:
{ "eslintConfig": { "root": true, "extends": ["@webbergreg/eslint-config/typescript-react"] } }
-
Add a linting script to your
package.json
file:-
TypeScript with React:
{ "scripts": { "lint": "npx eslint \"./src/**/*.*\"", "lint-fix": "npm run lint -- --fix", } }
-