Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a9f88ea

Browse files
committed
Add ga
1 parent a743403 commit a9f88ea

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

book.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
"description": "从 JavaScript 程序员的角度总结思考,循序渐进的理解 TypeScript。",
44
"author": "xcatliu <[email protected]>",
55
"language": "zh-hans",
6-
"plugins": ["disqus", "github"],
6+
"plugins": ["disqus", "github", "ga"],
77
"pluginsConfig": {
88
"disqus": {
99
"shortName": "typescript-tutorial"
1010
},
1111
"github": {
1212
"url": "https://github.com/xcatliu/typescript-tutorial"
13+
},
14+
"ga": {
15+
"token": "UA-45256157-14"
1316
}
1417
}
1518
}

ecosystem/eslint.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,23 @@ console.log(`My name is ${ myName }`)
6464

6565
## 安装
6666

67-
首先,我们需要安装 ESLint 和一些插件
67+
首先,我们需要安装 ESLint:
6868

6969
```bash
7070
npm install -g eslint
7171
```
7272

73-
关于 TypeScript 与 ESLint,有过一些争论:
73+
以上命令会在全局环境下安装 `eslint` 命令,安装完成之后,我们就可以在任何地方执行 `eslint` 命令了。
74+
75+
由于 ESLint 默认使用 [Espree](https://github.com/eslint/espree) 进行语法解析,无法识别 TypeScript 的一些语法,故我们需要安装 `typescript-eslint-parser`,替代掉默认的解析器:
76+
77+
```bash
78+
npm install -g typescript-eslint-parser
79+
```
80+
81+
## 创建配置文件
82+
83+
如果没有创建配置文件,那么
7484

7585
- 使用 ESLint 加上
7686

@@ -84,7 +94,6 @@ npm install -g eslint
8494

8595

8696
cannot read property type of null
87-
8897
react 规则不可用
8998

9099

0 commit comments

Comments
 (0)