What are the prerequisites for successfully using `parserOptions.project` with `@typescript-eslint/parser`?

Question

Grade: Education Subject: Support
What are the prerequisites for successfully using `parserOptions.project` with `@typescript-eslint/parser`?
Asked by:
107 Viewed 107 Answers

Answer (107)

Best Answer
(482)
For `parserOptions.project` to work correctly with `@typescript-eslint/parser`, you generally need to: 1. Have TypeScript installed in your project (`npm install typescript --save-dev` or `yarn add typescript --dev`). 2. Have a valid `tsconfig.json` file in your project root that correctly defines your project's compilation context. 3. Ensure that the path specified in `parserOptions.project` accurately points to your `tsconfig.json` file (or an array of `tsconfig.json` files).