Skip to content

Commit 7822c25

Browse files
xrkffggzombieJkerm1it
authored
chore: use father (#268)
* fix: Upload order issue (#272) * chore: Bump 3.2.1 * chore: use father * fix lint * add runtime * add compile * add block * update * test 14 * test 10 * fix alert * remove headers * fix eslint * remove ReactDOM * change tsx * refactor: change tsx * add UploadProps export * RCFile & pickAttrs * fix lint * fix alert * fix: types of upload Co-authored-by: 二货机器人 <[email protected]> Co-authored-by: Kermit <[email protected]>
1 parent bb07467 commit 7822c25

37 files changed

+615
-560
lines changed

.eslintrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const base = require("@umijs/fabric/dist/eslint");
2+
3+
module.exports = {
4+
...base,
5+
rules: {
6+
...base.rules,
7+
"react/no-array-index-key": 0,
8+
"react/sort-comp": 0,
9+
"@typescript-eslint/no-explicit-any": 0,
10+
"@typescript-eslint/no-empty-interface": 0,
11+
"@typescript-eslint/no-inferrable-types": 0,
12+
"react/no-find-dom-node": 0,
13+
"react/require-default-props": 0,
14+
"no-confusing-arrow": 0,
15+
"import/no-named-as-default-member": 0,
16+
"jsx-a11y/label-has-for": 0,
17+
"jsx-a11y/label-has-associated-control": 0,
18+
"import/no-extraneous-dependencies": 0,
19+
"no-underscore-dangle": 0,
20+
},
21+
};

.fatherrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default {
2+
cjs: "babel",
3+
esm: { type: "babel", importLibToEs: true },
4+
preCommit: {
5+
eslint: true,
6+
prettier: true,
7+
},
8+
runtimeHelpers: true,
9+
};

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ es
3030
package-lock.json
3131
tmp/
3232
.history
33+
.storybook
34+
.doc

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"proseWrap": "never",
5+
"printWidth": 100
6+
}

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ notifications:
77
88

99
node_js:
10-
- 6
10+
- 10
1111

1212
before_install:
1313
- |
@@ -29,4 +29,5 @@ env:
2929
matrix:
3030
- TEST_TYPE=lint
3131
- TEST_TYPE=test
32-
- TEST_TYPE=coverage
32+
- TEST_TYPE=coverage
33+
- TEST_TYPE=compile

examples/asyncAction.html

Whitespace-only changes.

examples/asyncAction.js renamed to examples/asyncAction.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/* eslint no-console:0 */
22
import React from 'react';
3-
import ReactDOM from 'react-dom';
4-
import Upload from 'rc-upload';
3+
import Upload from '..';
54

65
const props = {
76
action: () => {
8-
return new Promise((resolve) => {
7+
return new Promise(resolve => {
98
setTimeout(() => {
109
resolve('/upload.do');
1110
}, 2000);
@@ -31,10 +30,12 @@ const Test = () => {
3130
}}
3231
>
3332
<div>
34-
<Upload {...props}><a>开始上传</a></Upload>
33+
<Upload {...props}>
34+
<a>开始上传</a>
35+
</Upload>
3536
</div>
3637
</div>
3738
);
3839
};
3940

40-
ReactDOM.render(<Test/>, document.getElementById('__react-content'));
41+
export default Test;

examples/beforeUpload.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/beforeUpload.js renamed to examples/beforeUpload.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/* eslint no-console:0 */
22

33
import React from 'react';
4-
import ReactDOM from 'react-dom';
5-
import Upload from 'rc-upload';
4+
import Upload from '..';
65

76
const props = {
87
action: '/upload.do',
@@ -18,7 +17,7 @@ const props = {
1817
},
1918
beforeUpload(file, fileList) {
2019
console.log(file, fileList);
21-
return new Promise((resolve) => {
20+
return new Promise(resolve => {
2221
console.log('start check');
2322
setTimeout(() => {
2423
console.log('check finshed');
@@ -36,10 +35,12 @@ const Test = () => {
3635
}}
3736
>
3837
<div>
39-
<Upload {...props}><a>开始上传</a></Upload>
38+
<Upload {...props}>
39+
<a>开始上传</a>
40+
</Upload>
4041
</div>
4142
</div>
4243
);
4344
};
4445

45-
ReactDOM.render(<Test/>, document.getElementById('__react-content'));
46+
export default Test;

examples/customRequest.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)