diff --git a/projects/eslint-plugin-experience/all.js b/projects/eslint-plugin-experience/all.js index 372146e7..0e05d372 100644 --- a/projects/eslint-plugin-experience/all.js +++ b/projects/eslint-plugin-experience/all.js @@ -1,5 +1,4 @@ -const base = - projectJsonExist('tsconfig.eslint.json') || projectJsonExist('tsconfig.json') || ''; +process.env.TYPESCRIPT_ESLINT_EXPERIMENTAL_TSSERVER = 'true'; /** * @type {import('eslint').Linter.Config} @@ -117,7 +116,12 @@ module.exports = { ecmaVersion: 'latest', errorOnTypeScriptSyntacticAndSemanticIssues: false, errorOnUnknownASTType: true, - project: base ? [base] : [], + programs: [ + require('@typescript-eslint/parser').createProgram( + projectJsonExist('tsconfig.eslint.json') || + projectJsonExist('tsconfig.json'), + ), + ], sourceType: 'module', warnOnUnsupportedTypeScriptVersion: false, }, @@ -1025,7 +1029,7 @@ function projectJsonExist(filename) { try { const path = require('node:path').resolve(filename); - return require('node:fs').existsSync(path) ? filename : undefined; + return require('node:fs').existsSync(path) ? path : undefined; } catch { return undefined; } diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json deleted file mode 100644 index dc0e0391..00000000 --- a/tsconfig.eslint.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "rootDir": ".", - "baseUrl": ".", - "strict": true, - "module": "ESNext", - "target": "ESNext", - "incremental": true, - "esModuleInterop": true, - "typeRoots": [ - "./node_modules", - "node_modules/@types", - "taiga-ui/node_modules/@types", - "./taiga-ui/scripts/types" - ], - "types": ["ng-dev-mode", "node"] - }, - "exclude": ["**/node_modules"], - "extends": "./projects/tsconfig/tsconfig.json", - "include": ["**/*.ts", "projects/**/*.js"] -} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..47e0818d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "./projects/tsconfig/tsconfig.json", + "compilerOptions": { + "rootDir": ".", + "baseUrl": ".", + "strict": true, + "module": "ESNext", + "target": "ESNext", + "incremental": true, + "esModuleInterop": true, + "typeRoots": ["node_modules/@types"], + "types": ["node"] + }, + "include": ["**/*.ts", "**/*.js"], + "exclude": ["**/node_modules"] +}