Skip to content

Commit

Permalink
add lint-md & fix exist errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcc committed Dec 13, 2018
1 parent 583c8d8 commit cd045f2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
@@ -0,0 +1,6 @@
language: node_js
node_js:
- "10"
before_install:
- npm i -g lint-md
script: lint-md ./
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -8,7 +8,7 @@
- [在线阅读(GitHub 版)](https://github.com/xcatliu/typescript-tutorial/blob/master/README.md)
- [GitHub 地址][GitHub]
- 作者:[xcatliu](https://github.com/xcatliu/)
- 官方 QQ 群:[加入QQ群 767142358](https://jq.qq.com/?_wv=1027&k=5nkkFCl)
- 官方 QQ 群:[加入 QQ 群 767142358](https://jq.qq.com/?_wv=1027&k=5nkkFCl)

本书是作者在学习 [TypeScript] 后整理的学习笔记。

Expand Down
4 changes: 2 additions & 2 deletions advanced/enum.md
Expand Up @@ -84,7 +84,7 @@ var Days;

所以使用的时候需要注意,最好不要出现这种覆盖的情况。

手动赋值的枚举项可以不是数字,此时需要使用类型断言来让tsc无视类型检查 (编译出的js仍然是可用的):
手动赋值的枚举项可以不是数字,此时需要使用类型断言来让 tsc 无视类型检查 (编译出的 js 仍然是可用的):

```ts
enum Days {Sun = 7, Mon, Tue, Wed, Thu, Fri, Sat = <any>"S"};
Expand Down Expand Up @@ -145,7 +145,7 @@ enum Color {Red = "red".length, Green, Blue};
- 引用之前定义的常数枚举成员(可以是在不同的枚举类型中定义的)如果这个成员是在同一个枚举类型中定义的,可以使用非限定名来引用
- 带括号的常数枚举表达式
- `+`, `-`, `~` 一元运算符应用于常数枚举表达式
- `+`, `-`, `*`, `/`, `%`, `<<`, `>>`, `>>>`, `&`, `|`, `^` 二元运算符,常数枚举表达式做为其一个操作对象。若常数枚举表达式求值后为NaN或Infinity,则会在编译阶段报错
- `+`, `-`, `*`, `/`, `%`, `<<`, `>>`, `>>>`, `&`, `|`, `^` 二元运算符,常数枚举表达式做为其一个操作对象。若常数枚举表达式求值后为 NaN 或 Infinity,则会在编译阶段报错

所有其它情况的枚举成员被当作是需要计算得出的值。

Expand Down

0 comments on commit cd045f2

Please sign in to comment.