Avatar ·

خطأ "parserOptions.project has been set for @typescript-eslint/parser" — كيف أصلحه؟

مرحبًا! أنا مبتدئ في TypeScript وأحاول إعداد ESLint في مشروعي. أستخدم @typescript-eslint/parser و @typescript-eslint/eslint-plugin. لكن عند تشغيل ESLint أحصل على خطأ غريب: ``` Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. The file does not match your project config: src/index.ts. The file must be included in at least one of the projects provided. ``` إليك ملف .eslintrc.json الخاص بي: ```json { "parser": "@typescript-eslint/parser", "parserOptions": { "project": "./tsconfig.json" }, "plugins": ["@typescript-eslint"], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended" ] } ``` وملف tsconfig.json: ```json { "compilerOptions": { "target": "ES2020", "module": "commonjs", "strict": true, "esModuleInterop": true, "outDir": "./dist" }, "include": ["src/**/*"], "exclude": ["node_modules"] } ``` الملف src/index.ts موجود ويحتوي على