Getting Started with TypeScript
Install
Terminal
npm install --save-dev typescript-eslint @eslint-react/eslint-plugin
Setup
eslint.config.js
// @ts-check
import eslintJs from "@eslint/js";
import eslintReact from "@eslint-react/eslint-plugin";
import tseslint from "typescript-eslint";
export default tseslint.config({
files: ["**/*.ts", "**/*.tsx"],
extends: [
eslintJs.configs.recommended,
tseslint.configs.recommended,
eslintReact.configs.recommended,
],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
},
},
rules: {
// Put rules you want to override here
"@eslint-react/prefer-shorthand-boolean": "warn",
},
});