NPM: Use exact version. PR833
This commit is contained in:
parent
c25ca41728
commit
888ce47c5d
@ -32,6 +32,7 @@ export { localPromise as Promise };
|
||||
TypeScript 1.8里,我们添加了一些[可达性检查](https://github.com/Microsoft/TypeScript/pull/4788)来阻止一些种类的错误。特别是:
|
||||
|
||||
1. 检查代码的可达性(默认启用,可以通过`allowUnreachableCode`编译器选项禁用)
|
||||
|
||||
```ts
|
||||
function test1() {
|
||||
return 1;
|
||||
@ -48,7 +49,9 @@ TypeScript 1.8里,我们添加了一些[可达性检查](https://github.com/Mi
|
||||
var y = 1; // error here
|
||||
}
|
||||
```
|
||||
|
||||
2. 检查标签是否被使用(默认启用,可以通过`allowUnusedLabels`编译器选项禁用)
|
||||
|
||||
```ts
|
||||
l: // error will be reported - label `l` is unused
|
||||
while (true) {
|
||||
@ -56,6 +59,7 @@ TypeScript 1.8里,我们添加了一些[可达性检查](https://github.com/Mi
|
||||
|
||||
(x) => { x:x } // error will be reported - label `x` is unused
|
||||
```
|
||||
|
||||
3. 检查是否函数里所有带有返回值类型注解的代码路径都返回了值(默认启用,可以通过`noImplicitReturns`编译器选项禁用)
|
||||
|
||||
```ts
|
||||
@ -64,6 +68,7 @@ TypeScript 1.8里,我们添加了一些[可达性检查](https://github.com/Mi
|
||||
if (x) return 10;
|
||||
}
|
||||
```
|
||||
|
||||
4. 检查控制流是否能进到switch语句的case里(默认禁用,可以通过`noFallthroughCasesInSwitch`编译器选项启用)。注意没有语句的case不会被检查。
|
||||
|
||||
```ts
|
||||
|
32
package-lock.json
generated
32
package-lock.json
generated
@ -36,9 +36,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"entities": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
|
||||
"integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
|
||||
"integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==",
|
||||
"dev": true
|
||||
},
|
||||
"fs.realpath": {
|
||||
@ -78,18 +78,18 @@
|
||||
"dev": true
|
||||
},
|
||||
"linkify-it": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.0.3.tgz",
|
||||
"integrity": "sha1-2UpGSPmxwXnWT6lykSaL22zpQ08=",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.1.0.tgz",
|
||||
"integrity": "sha512-4REs8/062kV2DSHxNfq5183zrqXMl7WP0WzABH9IeJI+NLm429FgE1PDecltYfnOoFDFlZGh2T8PfZn0r+GTRg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"uc.micro": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"markdown-it": {
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.1.tgz",
|
||||
"integrity": "sha512-CzzqSSNkFRUf9vlWvhK1awpJreMRqdCrBvZ8DIoDWTOkESMIF741UPAhuAmbyWmdiFPA6WARNhnu2M6Nrhwa+A==",
|
||||
"version": "8.4.2",
|
||||
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz",
|
||||
"integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"argparse": "^1.0.7",
|
||||
@ -100,12 +100,12 @@
|
||||
}
|
||||
},
|
||||
"markdownlint": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.3.1.tgz",
|
||||
"integrity": "sha1-i8WtW62KJLP8+lqlzRzrjgY8ScY=",
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.11.0.tgz",
|
||||
"integrity": "sha512-wE5WdKD6zW2DQaPQ5TFBTXh5j76DnWd/IFffnDQgHmi6Y61DJXBDfLftZ/suJHuv6cwPjM6gKw2GaRLJMOR+Mg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"markdown-it": "^8.0.1"
|
||||
"markdown-it": "8.4.2"
|
||||
}
|
||||
},
|
||||
"mdurl": {
|
||||
@ -145,9 +145,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"uc.micro": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.5.tgz",
|
||||
"integrity": "sha512-JoLI4g5zv5qNyT09f4YAvEZIIV1oOjqnewYg5D38dkQljIzpPT296dbIGvKro3digYI1bkb7W6EP1y4uDlmzLg==",
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
|
||||
"integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==",
|
||||
"dev": true
|
||||
},
|
||||
"wrappy": {
|
||||
|
@ -26,7 +26,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/zhongsp/TypeScript",
|
||||
"devDependencies": {
|
||||
"glob": "^7.1.3",
|
||||
"markdownlint": "^0.3.1"
|
||||
"glob": "7.1.3",
|
||||
"markdownlint": "0.11.0"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user