ts的基本用法和其中对应的属性和参数的使用方法;

    1. {
    2. compilerOptions”:{
    3. "target": "es5", // target用于指定编译之后的版本目录
    4. "module": "commonjs", // module用来指定要使用的模板标准
    5. "lib":[ // lib用于指定要包含在编译中的库文件
    6. "es6",
    7. "dom"
    8. ],
    9. "allowJs": true, // allowJs用来指定是否允许编译JS文件,默认false,即不编译JS文件
    10. "checkJs": true, // checkJs用来指定是否检查和报告JS文件中的错误,默认false
    11. "jsx": "preserve", // 指定jsx代码用于的开发环境:'preserve','react-native',or 'react
    12. "declaration": true, // declaration用来指定是否在编译的时候生成相的d.ts声明文件,如果设为true,编译每个ts文件之后会生成一个js文件和一个声明文件,但是declarationallowJs不能同时设为true
    13. "declarationMap": true, // declarationMap用来指定编译时是否生成.map文件
    14. "sourceMap": true, // socuceMap用来指定编译时是否生成.map文件
    15. "outFile": "./", // outFile用于指定输出文件合并为一个文件,只有设置module的值为amdsystem模块时才支持这个配置
    16. "outDir": "./", // outDir用来指定输出文件夹,值为一个文件夹路径字符串,输出的文件都将放置在这个文件夹
    17. "rootDir": "./", // rootDir用来指定编译文件的根目录,编译器会在根目录查找入口文件
    18. "composite": true, // composite是否编译构建引用项目
    19. "removeComments": true, // removeComments用于指定是否将编译后的文件注释删掉,设为true的话即删除注释,默认为false
    20. "noEmit": true, // noEmit不生成编译文件
    21. "importHelpers": true, // importHelpers指定是否引入tslib里的复制工具函数,默认为false
    22. "downlevelIteration": true, //当target"ES5""ES3"时,为"for-of" "spread""destructuring"中的迭代器提供完全支持
    23. "isolatedModules": true, // isolatedModules指定是否将每个文件作为单独的模块,默认为true,他不可以和declaration同时设定
    24. "strict": true, // strict用于指定是否启动所有类型检查,如果设为true这回同时开启下面这几个严格检查,默认为false
    25. "noImplicitAny": true, // strictNullChecks当设为true时,nullundefined值不能赋值给非这两种类型的值,别的类型的值也不能赋给他们,除了any类型,还有个例外就是undefined可以赋值给void类型
    26. }
    27. }