vue2 js项目jsconfig精简配置带注释

288 阅读1分钟

用以支持@等alias解析,js带ts支持等。其他按需的注释直接看tsconfig的文档,不要搜jsconfig

{
    "compilerOptions": {
        "baseUrl": ".",
        "paths": {
            // 解决项目中使用@作为路径别名,导致vscode无法跳转文件的问题
            "@/*": ["src/*"]
        },
        // 解决prettier对于装饰器语法的警告
        "experimentalDecorators": true,
        // 解决.jsx文件无法快速跳转的问题
        // "jsx": "preserve",
        // true时开启类型检查,@ts-nocheck @ts-check 该文件是否检查 @ts-ignore 行忽略 @ts-expect-error 预期有错,没错反而报错
        "checkJs": false,
        },
    //提高 IDE 性能
    // "exclude": ["node_modules", "dist", "build"],
    "include": ["./src"],
    "vueCompilerOptions": {
        // 跳过对template的校验
        "skipTemplateCodegen": true
      }
}