Skip to content

Commit 5aa7692

Browse files
committed
Use pagic
1 parent 43417b8 commit 5aa7692

23 files changed

+5241
-4027
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
_book
21
*.d.ts

.eslintrc.js

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
module.exports = {
2-
extends: ['alloy', 'alloy/typescript'],
3-
env: {
4-
// 您的环境变量(包含多个预定义的全局变量)
5-
// Your environments (which contains several predefined global variables)
6-
//
7-
// browser: true,
8-
// node: true,
9-
// mocha: true,
10-
// jest: true,
11-
// jquery: true
12-
},
13-
globals: {
14-
// 您的全局变量(设置为 false 表示它不允许被重新赋值)
15-
// Your global variables (setting to false means it's not allowed to be reassigned)
16-
//
17-
// myGlobal: false
18-
},
19-
rules: {
20-
// 自定义您的规则
21-
// Customize your rules
22-
'no-undef': 'off',
23-
'@typescript-eslint/no-require-imports': 'off'
24-
}
2+
extends: ['alloy', 'alloy/react', 'alloy/typescript'],
3+
env: {
4+
// Your environments (which contains several predefined global variables)
5+
//
6+
// browser: true,
7+
// mocha: true,
8+
// jquery: true
9+
},
10+
globals: {
11+
// Your global variables (setting to false means it's not allowed to be reassigned)
12+
//
13+
// myGlobal: false
14+
},
15+
rules: {
16+
// Customize your rules
17+
'no-undef': 'off',
18+
'@typescript-eslint/no-invalid-this': 'off',
19+
'@typescript-eslint/no-require-imports': 'off',
20+
'@typescript-eslint/method-signature-style': 'off'
21+
}
2522
};

.gitbook.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/gh-pages.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: gh-pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-18.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Build
15+
run: |
16+
curl -fsSL https://deno.land/x/install/install.sh | sh -s v1.0.0
17+
export DENO_INSTALL="/home/runner/.deno"
18+
export PATH="$DENO_INSTALL/bin:$PATH"
19+
deno --version
20+
deno install --unstable --allow-read --allow-write --allow-net https://deno.land/x/pagic/pagic.ts
21+
pagic build
22+
23+
- name: Deploy
24+
uses: peaceiris/actions-gh-pages@v3
25+
with:
26+
github_token: ${{ secrets.GITHUB_TOKEN }}
27+
publish_dir: ./public
28+
cname: ts.xcatliu.com

.gitignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
node_modules
2-
*.log
3-
41
.DS_Store
5-
6-
_book
2+
node_modules
3+
public

.prettierignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ node_modules
22

33
*.md
44

5-
_book
65
assets
76

87
.DS_Store
@@ -14,5 +13,5 @@ assets
1413

1514
package-lock.json
1615

17-
examples/declaration-files/19-export-default-enum-error/types/foo/index.d.ts
18-
examples/**/*.js
16+
examples
17+
public

.prettierrc.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// .prettierrc.js
2+
module.exports = {
3+
// max 120 characters per line
4+
printWidth: 120,
5+
// use 2 spaces for indentation
6+
tabWidth: 2,
7+
// use spaces instead of indentations
8+
useTabs: false,
9+
// semicolon at the end of the line
10+
semi: true,
11+
// use single quotes
12+
singleQuote: true,
13+
// object's key is quoted only when necessary
14+
quoteProps: 'as-needed',
15+
// use double quotes instead of single quotes in jsx
16+
jsxSingleQuote: false,
17+
// no comma at the end
18+
trailingComma: 'none',
19+
// spaces are required at the beginning and end of the braces
20+
bracketSpacing: true,
21+
// end tag of jsx need to wrap
22+
jsxBracketSameLine: false,
23+
// brackets are required for arrow function parameter, even when there is only one parameter
24+
arrowParens: 'always',
25+
// format the entire contents of the file
26+
rangeStart: 0,
27+
rangeEnd: Infinity,
28+
// no need to write the beginning @prettier of the file
29+
requirePragma: false,
30+
// No need to automatically insert @prettier at the beginning of the file
31+
insertPragma: false,
32+
// use default break criteria
33+
proseWrap: 'preserve',
34+
// decide whether to break the html according to the display style
35+
htmlWhitespaceSensitivity: 'css',
36+
// lf for newline
37+
endOfLine: 'lf'
38+
};

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
2-
"files.eol": "\n",
3-
"editor.tabSize": 4,
4-
"editor.formatOnSave": true,
5-
"typescript.tsdk": "node_modules/typescript/lib",
6-
"editor.codeActionsOnSave": {
7-
"source.fixAll": true
8-
},
9-
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue"]
2+
"files.eol": "\n",
3+
"editor.tabSize": 2,
4+
"editor.formatOnSave": true,
5+
"editor.defaultFormatter": "esbenp.prettier-vscode",
6+
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
7+
"editor.codeActionsOnSave": {
8+
// 保存时自动修复 ESLint 错误
9+
"source.fixAll.eslint": true
10+
},
11+
"typescript.tsdk": "node_modules/typescript/lib"
1012
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
## 关于本书
88

9-
- [在线阅读](https://ts.xcatliu.com/)(部署在 [GitBook](https://www.gitbook.com/book/xcatliu/typescript-tutorial/details) 上,可能需要翻墙)
10-
- [在线阅读(GitHub 版)](https://github.com/xcatliu/typescript-tutorial/blob/master/README.md)
9+
- [在线阅读](https://ts.xcatliu.com/)
10+
- [在线阅读(GitHub 版)](https://github.com/xcatliu/typescript-tutorial/blob/master/docs/README.md)
1111
- [GitHub 地址][GitHub]
1212
- 作者:[xcatliu](https://github.com/xcatliu/)
1313
- 官方 QQ 群:[加入 QQ 群 767142358](https://jq.qq.com/?_wv=1027&k=5nkkFCl)

0 commit comments

Comments
 (0)