Project scenario:
vue+ts+setup 语法糖 declaration+interface+defineProps 报错
Problem Description
When declaring an interface, no matter what interface name is used, the above error will be reported
solution:
Tip: modify tsconfig.json, add "declaration": false,
{
"compilerOptions": {
"declaration": false,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"strict": true,
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Node",
"lib": ["ESNext", "dom"],
"jsx": "preserve",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"paths": {
"@/*": ["src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}