Skip to content

Commit d9cc76a

Browse files
committed
Add prettier
1 parent 49a7841 commit d9cc76a

File tree

8 files changed

+1678
-17
lines changed

8 files changed

+1678
-17
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

.eslintrc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"env": {
3+
"es2021": true,
4+
"mocha": true,
5+
"node": true
6+
},
7+
"extends": ["standard-with-typescript", "prettier"],
8+
"parserOptions": {
9+
"ecmaVersion": 2021,
10+
"project": "tsconfig.json",
11+
"sourceType": "module"
12+
},
13+
"plugins": ["@typescript-eslint"],
14+
"rules": {
15+
"@typescript-eslint/explicit-function-return-type": "off",
16+
"@typescript-eslint/naming-convention": "off",
17+
"@typescript-eslint/no-namespace": "off",
18+
"@typescript-eslint/restrict-plus-operands": "off",
19+
"@typescript-eslint/restrict-template-expressions": "off",
20+
"@typescript-eslint/strict-boolean-expressions": "off"
21+
}
22+
}

.github/workflows/build.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
build-check:
10+
name: Build check
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- run: yarn
18+
- run: yarn lint
19+
- run: yarn build

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
publish:
10+
name: Publish
11+
12+
if: github.repository_owner == 'coajs'
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- uses: actions/setup-node@v1
20+
with:
21+
node-version: 12
22+
registry-url: https://registry.npmjs.org
23+
24+
- name: Yarn
25+
run: |
26+
yarn
27+
28+
- name: Lint
29+
run: |
30+
yarn lint
31+
32+
- name: Build
33+
run: |
34+
yarn version --no-git-tag-version --new-version ${{ github.event.release.tag_name }}
35+
yarn build
36+
37+
- name: Publish
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.AEX_NPM_TOKEN }}
40+
run: |
41+
yarn publish dist
42+
43+
- name: Sync
44+
run: |
45+
sleep 5s
46+
yarn sync

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

.prettierrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 160,
3+
"semi": false,
4+
"singleQuote": true
5+
}

package.json

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "coa-env",
3-
"version": "1.1.0",
3+
"version": "0.0.0",
44
"description": "env component for coa",
55
"keywords": [
66
"coajs",
@@ -16,14 +16,24 @@
1616
},
1717
"scripts": {
1818
"dev": "tsc -w",
19-
"build": "rm -rf dist && tsc && cp package.json dist",
20-
"npm-publish": "yarn build && yarn version --patch && cp package.json README.md dist && cd dist && npm publish"
19+
"build": "rm -rf dist && tsc && cp package.json *.md dist",
20+
"lint": "eslint .",
21+
"prettier": "prettier -w .",
22+
"sync": "curl -X PUT 'https://npm.taobao.org/sync/coa-env?sync_upstream=true'"
2123
},
2224
"dependencies": {
23-
"coa-error": "^1.1.3"
25+
"coa-error": "^1.5.2"
2426
},
2527
"devDependencies": {
26-
"@types/node": "^14.14.33",
27-
"typescript": "^4.2.3"
28+
"@types/node": "^15.6.2",
29+
"@typescript-eslint/eslint-plugin": "^4.26.0",
30+
"eslint": "^7.27.0",
31+
"eslint-config-prettier": "^8.3.0",
32+
"eslint-config-standard-with-typescript": "^20.0.0",
33+
"eslint-plugin-import": "^2.23.4",
34+
"eslint-plugin-node": "^11.1.0",
35+
"eslint-plugin-promise": "^5.1.0",
36+
"prettier": "^2.3.0",
37+
"typescript": "^4.3.2"
2838
}
2939
}

0 commit comments

Comments
 (0)