当前位置:网站首页>Typescript from getting started to mastering (XVI) configuration file - first knowledge of compileroptions configuration item
Typescript from getting started to mastering (XVI) configuration file - first knowledge of compileroptions configuration item
2022-07-29 03:44:00 【Haha, APE】
Know and learn tsconfig.json in compilerOptions Configuration item
removeComments attribute :
removeComments yes complerOptions A sub attribute in , Its purpose is to tell TypeScript Yes, compiled js Whether the file displays comments ( annotation ). For example, we now put removeComments Is set to true, Is in the js Do not show comments in .
// I'm xiaoha
let perosn:string =" Ha "
After writing the notes , Directly in the terminal , Input tsc, When you're done typing , A will be generated soon Demo.js file , After opening, you will see the following code .
"use strict";
var perosn = " Ha ";
The comments written in this way are not compiled to Demo.js in
strict attribute :
strict Property if set to true, It represents our compilation and writing specifications , According to TypeScript The strictest standard to write , If we set this to false Or comment out , It means that we can set some loose writing methods for .
noImplicitAny attribute :
noImplicitAny The function of attributes is , Allow your annotation type any Don't make it clear
For better explanation , Let's take an example , stay Demo.ts in , Write a method , We set the parameters of the method to any type (any)
function xiaoha(name){
return name
}
At this time, our TypeScript It is for error reporting , We use it tsc Compilation is also an error . That's because we opened strict:true, Let's comment out , And then put noImplicitAny Is set to false, No more misstatements .
- If set to
noImplicitAny:true,It means value, even if it isany( Any value ), You also have to type comment .

Simply understood as ,noImplicitAny Set to true, Namely The top must be clearly set any Type value .
strictNullChecks attribute :
strictNullChecks Set to false, It means , No mandatory inspection NULL type .
Here's the picture :
If instead true when , Mandatory inspection NULL type , If there is, report an error
Here's the picture :
边栏推荐
- 1985-2020(8个版次)全球地表覆盖下载与介绍
- Machine learning [numpy]
- Ribbon principle analysis namedcontextfactory
- How fast does it take to implement a super simple programming language?
- Uni app internationalization
- Realize multi-level linkage through recursion
- Simple code implementation of K-means clustering
- tron OUT_ OF_ ENERGY
- (newcoder 15079) irrelevant (inclusion exclusion principle)
- RTP send and receive h265
猜你喜欢

Connection broken by 'readtimc rt-443): read timed out (read timeout=l5)“)‘: /pac

深入C语言(1)——操作符与表达式

Solve the problem of garbled code when opening the project code in idea

Whole process record of yolov3 target detection

Vs code must know and know 20 shortcut keys!

Uni app internationalization

Why BGP server is used in sunflower remote control? Automatic optimal route and high-speed transmission across operators

Deep understanding of Base64 underlying principles

Microcomputer principle and interface technology

Shutter start white screen
随机推荐
Simple use of eventbus
Sleuth+zipkin to track distributed service links
Simple understanding of CDN, SDN and QoS
Introduction and comparison of unicast, multicast (target broadcast, multicast), broadcast, flooding, flooding
《陌路曾相逢》夏陌沈疏晏_夏陌沈疏晏最新章节
3.2 model saving and loading
for_each用法示例
"Strangers once met" Summer Street Shen Shuyan_ Xia Mo Shen Shuyan's latest chapter
Various minor problems of jupyter notebook, configuration environment, code completion, remote connection, etc
最新二开版漫画小说听书三合一完整源码/整合免签接口/搭建教程/带采集接口
What have I learned from 200 machine learning tools?
RTP 发送 和接收 h265
for_ Example of each usage
Deep into C language (1) -- operators and expressions
@Configuration (proxybeanmethods = false) what's the use of setting this to false
In depth C language (2) -- definition and use of structure
Sunflower senior product director technology sharing: "how to apply national remote control" in AD domain environment
2. 变量及作用域
Cloudera manager platform fault repair record
Solve the problem of garbled code when opening the project code in idea