Я хотел знать, как я могу включить это в проекте TypeScript. < /p>
i 'M В настоящее время использует TypeScript 5.7.3 и иметь следующие tsconfig.json:
Код: Выделить всё
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "ESNext",
"noImplicitOverride": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noPropertyAccessFromIndexSignature": true,
"jsx": "react-jsx"
},
"files": [],
"include": ["src/types/**/*.ts", "src/**/*.ts", "src/**/*.tsx"],
"references": [
{
"path": "./tsconfig.lib.json"
}
]
}
< /code>
dtsconfig.base.json:
{
"compileOnSave": false,
"compilerOptions": {
"rootDir": ".",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"esModuleInterop": true,
"target": "ES2024",
"module": "ESNext",
"lib": ["ES2024", "DOM", "ESNext", "ES2024.Promise"],
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"strict": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"types": ["node"],
"paths": {
"@alertdown/auth": ["libs/auth/src/index.ts"],
"@alertdown/common": ["libs/common/src/index.ts"],
"@alertdown/core": ["libs/core/src/index.ts"],
"@alertdown/db": ["libs/db/src/index.ts"],
"@alertdown/email": ["libs/email/src/index.ts"],
"@alertdown/google": ["libs/google/src/index.ts"],
"@alertdown/infrastructure": ["libs/infrastructure/src/index.ts"],
"@alertdown/llm": ["libs/llm/src/index.ts"],
"@alertdown/notifications": ["libs/notifications/src/index.ts"],
"@alertdown/payments": ["libs/payments/src/index.ts"],
"@alertdown/playwright": ["libs/playwright/src/index.ts"],
"@alertdown/prototyping": ["libs/prototyping/src/index.ts"],
"@alertdown/site": ["libs/site/src/index.ts"],
"@alertdown/site-domain": ["libs/site-domain/src/index.ts"],
"@alertdown/storage": ["libs/storage/src/index.ts"],
"@alertdown/stripe": ["libs/stripe/src/index.ts"],
"@alertdown/temporal-client": ["libs/temporal-client/src/index.ts"],
"@alertdown/ui": ["libs/ui/src/index.ts"]
}
},
"exclude": ["node_modules", "tmp"]
}
< /code>
Я думал, что Esnext будет охватывать все случаи или ES2024.Property 'try' does not exist on type 'PromiseConstructor'.ts(2339)Есть идеи?
Подробнее здесь: https://stackoverflow.com/questions/794 ... typescript