Skip to content

Commit c035022

Browse files
committed
feat: deploy 16
1 parent a9325a9 commit c035022

File tree

4 files changed

+177
-254
lines changed

4 files changed

+177
-254
lines changed

.eslintrc

+9-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@
2727
}
2828
},
2929
"plugins": ["babel", "@typescript-eslint", "react-hooks"],
30-
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:react/recommended", "airbnb-base"],
30+
"extends": [
31+
"eslint:recommended",
32+
"plugin:@typescript-eslint/recommended",
33+
"plugin:react/recommended",
34+
"airbnb-base",
35+
"prettier/@typescript-eslint",
36+
"prettier"
37+
],
3138
"rules": {
3239
"func-names": 0,
3340
"one-var": [1, "never"],
@@ -115,4 +122,4 @@
115122
}
116123
]
117124
}
118-
}
125+
}

package.json

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pri",
3-
"version": "3.3.28-beta.15",
3+
"version": "3.3.28-beta.16",
44
"types": "src/node/index.ts",
55
"main": "built/node/index.js",
66
"scripts": {
@@ -35,7 +35,6 @@
3535
"@babel/plugin-proposal-json-strings": "7.2.0",
3636
"@babel/plugin-proposal-numeric-separator": "7.2.0",
3737
"@babel/plugin-proposal-optional-catch-binding": "7.2.0",
38-
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
3938
"@babel/plugin-proposal-throw-expressions": "7.2.0",
4039
"@babel/plugin-syntax-dynamic-import": "7.2.0",
4140
"@babel/plugin-syntax-import-meta": "7.2.0",
@@ -69,8 +68,8 @@
6968
"@types/webpack-dev-server": "3.1.6",
7069
"@types/webpack-serve": "2.0.1",
7170
"@types/yargs": "13.0.0",
72-
"@typescript-eslint/eslint-plugin": "2.7.0",
73-
"@typescript-eslint/parser": "2.7.0",
71+
"@typescript-eslint/eslint-plugin": "1.11.0",
72+
"@typescript-eslint/parser": "1.11.0",
7473
"babel-core": "7.0.0-bridge.0",
7574
"babel-loader": "8.0.6",
7675
"babel-plugin-react-css-modules": "5.2.6",
@@ -81,13 +80,15 @@
8180
"conventional-changelog-cli": "^2.0.25",
8281
"cors": "2.8.5",
8382
"css-loader": "3.0.0",
84-
"eslint": "6.6.0",
83+
"eslint": "6.0.1",
8584
"eslint-config-airbnb-base": "13.2.0",
85+
"eslint-config-prettier": "6.0.0",
8686
"eslint-import-resolver-webpack": "0.11.1",
8787
"eslint-plugin-babel": "5.3.0",
88-
"eslint-plugin-import": "2.18.2",
89-
"eslint-plugin-react": "7.16.0",
90-
"eslint-plugin-react-hooks": "2.2.0",
88+
"eslint-plugin-import": "2.18.0",
89+
"eslint-plugin-prettier": "3.1.0",
90+
"eslint-plugin-react": "7.14.2",
91+
"eslint-plugin-react-hooks": "1.6.1",
9192
"file-loader": "4.0.0",
9293
"fs-extra": "8.1.0",
9394
"gulp": "^4.0.2",
@@ -136,14 +137,14 @@
136137
"socket.io": "2.2.0",
137138
"socket.io-client": "2.2.0",
138139
"style-loader": "0.23.1",
139-
"typescript": "3.7.2",
140+
"typescript": "3.5.3",
140141
"update-notifier": "3.0.1",
141142
"url-join": "4.0.1",
142143
"url-loader": "2.0.1",
143144
"walk": "2.3.14",
144145
"webpack": "4.41.2",
145146
"webpack-bundle-analyzer": "3.3.2",
146-
"webpack-dev-server": "3.9.0",
147+
"webpack-dev-server": "3.7.2",
147148
"webpack-node-externals": "1.7.2",
148149
"webpack-sources": "1.3.0",
149150
"webpackbar": "3.2.0",

src/utils/type-checker.ts

+27-27
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,36 @@ import { pri } from '../node';
44
import { logFatal, logInfo, logSuccess } from './log';
55

66
export function typeChecker() {
7-
const stashFileCnt = +execSync('git diff --cached --numstat --diff-filter=ACM | wc -l').toString('utf8');
7+
const stashFileCnt = +execSync('git diff --cached --numstat --diff-filter=ACM | wc -l').toString('utf8');
88

9-
if (stashFileCnt > 0) {
10-
let debugFiles = '';
9+
if (stashFileCnt > 0) {
10+
let debugFiles = '';
1111

12-
try {
13-
debugFiles = execSync(
14-
"grep -in '@DEBUG' --include *.ts --include *.tsx --include *.js --include *.scss --include *.css $(git diff --cached --name-only --diff-filter=ACM) /dev/null",
15-
{
16-
shell: 'bash',
17-
stdio: [0, 1],
18-
},
19-
).toString('utf8');
20-
// eslint-disable-next-line no-empty
21-
} catch (e) {}
12+
try {
13+
debugFiles = execSync(
14+
"grep -in '@DEBUG' --include *.ts --include *.tsx --include *.js --include *.scss --include *.css $(git diff --cached --name-only --diff-filter=ACM) /dev/null",
15+
{
16+
shell: 'bash',
17+
stdio: [0, 1],
18+
},
19+
).toString('utf8');
20+
// eslint-disable-next-line no-empty
21+
} catch (e) {}
2222

23-
if (debugFiles) {
24-
logFatal('@DEBUG identifier exists, the commit is terminated');
25-
process.exit(1);
26-
}
23+
if (debugFiles) {
24+
logFatal('@DEBUG identifier exists, the commit is terminated');
25+
process.exit(1);
2726
}
27+
}
2828

29-
logInfo('Checking TypeScript type, please wait');
30-
try {
31-
execSync(`${pri.projectRootPath}/node_modules/.bin/tsc -p . || exit 1`, {
32-
stdio: [0, 1, 2],
33-
});
34-
} catch (e) {
35-
logFatal('Type checks error!');
36-
process.exit(1);
37-
}
38-
logSuccess('Type checks passed!');
29+
logInfo('Checking TypeScript type, please wait');
30+
try {
31+
execSync(`${pri.projectRootPath}/node_modules/.bin/tsc -p . || exit 1`, {
32+
stdio: [0, 1, 2],
33+
});
34+
} catch (e) {
35+
logFatal('Type checks error!');
36+
process.exit(1);
37+
}
38+
logSuccess('Type checks passed!');
3939
}

0 commit comments

Comments
 (0)