Skip to content

Commit 4bada1e

Browse files
xrkffggafc163
andauthored
chore: use father (#85)
* chore: use father * fix test * change name * update lint * update * uptate ci * update * update * update * update * update * remove rc-tools * add lock * update * update * Update .travis.yml * update ts * update package * fix name up * add test * fix example & define Co-authored-by: 偏右 <[email protected]>
1 parent 3d693d8 commit 4bada1e

27 files changed

+481
-170
lines changed

.eslintrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const base = require('@umijs/fabric/dist/eslint');
2+
3+
module.exports = {
4+
...base,
5+
rules: {
6+
...base.rules,
7+
'no-template-curly-in-string': 0,
8+
'prefer-promise-reject-errors': 0,
9+
'react/no-array-index-key': 0,
10+
'react/sort-comp': 0,
11+
'@typescript-eslint/no-explicit-any': 0,
12+
'jsx-a11y/role-supports-aria-props': 0,
13+
'jsx-a11y/no-noninteractive-tabindex': 0,
14+
'import/no-extraneous-dependencies': 0,
15+
},
16+
};

.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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ build
2727
lib
2828
es
2929
coverage/
30-
yarn.lock
30+
yarn.lock
31+
package-lock.json
32+
.storybook
33+
.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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ sudo: false
55
notifications:
66
email:
77
8-
9-
108

119
node_js:
12-
- 10
10+
- 12
1311

1412
script:
1513
- |
@@ -19,7 +17,10 @@ script:
1917
else
2018
npm run $TEST_TYPE
2119
fi
20+
2221
env:
2322
matrix:
2423
- TEST_TYPE=lint
2524
- TEST_TYPE=test
25+
- TEST_TYPE=coverage
26+
- TEST_TYPE=compile

assets/index.less

Whitespace-only changes.

examples/fast-progress.html

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

examples/fast-progress.js renamed to examples/fast-progress.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import 'rc-progress/assets/index.less';
2-
import React, { Component } from 'react';
3-
import ReactDOM from 'react-dom';
4-
import { Line, Circle } from 'rc-progress';
1+
import * as React from 'react';
2+
import { Line, Circle, ProgressProps } from '../src';
53

6-
class App extends Component {
7-
constructor() {
8-
super();
4+
class App extends React.Component<ProgressProps, any> {
5+
constructor(props) {
6+
super(props);
97
this.state = {
108
percent: 0,
119
};
1210
this.increase = this.increase.bind(this);
1311
this.restart = this.restart.bind(this);
1412
}
1513

14+
private tm: number;
15+
1616
componentDidMount() {
1717
this.increase();
1818
}
@@ -39,8 +39,8 @@ class App extends Component {
3939
const { percent } = this.state;
4040
return (
4141
<div style={{ margin: 10, width: 200 }}>
42-
<Circle strokeWidth="6" percent={percent} />
43-
<Line strokeWidth="4" percent={percent} />
42+
<Circle strokeWidth={6} percent={percent} />
43+
<Line strokeWidth={4} percent={percent} />
4444
<button type="button" onClick={this.restart}>
4545
Restart
4646
</button>
@@ -49,4 +49,4 @@ class App extends Component {
4949
}
5050
}
5151

52-
ReactDOM.render(<App />, document.getElementById('__react-content'));
52+
export default App;

examples/gap.html

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

examples/gap.js renamed to examples/gap.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import 'rc-progress/assets/index.less';
2-
import React, { Component } from 'react';
3-
import ReactDOM from 'react-dom';
4-
import { Circle } from 'rc-progress';
1+
import * as React from 'react';
2+
import { Circle, ProgressProps } from '../src';
53

64
const colorMap = ['#3FC7FA', '#85D262', '#FE8C6A'];
5+
76
function getColor(index) {
87
return colorMap[(index + colorMap.length) % colorMap.length];
98
}
10-
class Example extends Component {
11-
constructor() {
12-
super();
9+
10+
class Example extends React.Component<ProgressProps, any> {
11+
constructor(props) {
12+
super(props);
1313
this.state = {
1414
percent: 30,
1515
colorIndex: 0,
@@ -18,8 +18,8 @@ class Example extends Component {
1818
}
1919

2020
changeState() {
21-
const value = parseInt(Math.random() * 100, 10);
22-
const colorIndex = parseInt(Math.random() * 3, 10);
21+
const value = parseInt((Math.random() * 100).toString(), 10);
22+
const colorIndex = parseInt((Math.random() * 3).toString(), 10);
2323
this.setState({
2424
percent: value,
2525
colorIndex,
@@ -45,7 +45,7 @@ class Example extends Component {
4545
percent={percent}
4646
gapDegree={70}
4747
gapPosition="top"
48-
strokeWidth="6"
48+
strokeWidth={6}
4949
strokeLinecap="square"
5050
strokeColor={color}
5151
/>
@@ -55,8 +55,8 @@ class Example extends Component {
5555
percent={[percent / 3, percent / 3, percent / 3]}
5656
gapDegree={70}
5757
gapPosition="bottom"
58-
strokeWidth="6"
59-
trailWidth="6"
58+
strokeWidth={6}
59+
trailWidth={6}
6060
strokeLinecap="round"
6161
strokeColor={[color, getColor(colorIndex + 1), getColor(colorIndex + 2)]}
6262
/>
@@ -67,7 +67,7 @@ class Example extends Component {
6767
percent={percent}
6868
gapDegree={70}
6969
gapPosition="left"
70-
strokeWidth="6"
70+
strokeWidth={6}
7171
strokeLinecap="square"
7272
strokeColor={color}
7373
/>
@@ -77,7 +77,7 @@ class Example extends Component {
7777
percent={percent}
7878
gapDegree={70}
7979
gapPosition="right"
80-
strokeWidth="6"
80+
strokeWidth={6}
8181
strokeLinecap="square"
8282
strokeColor={color}
8383
/>
@@ -87,4 +87,4 @@ class Example extends Component {
8787
}
8888
}
8989

90-
ReactDOM.render(<Example />, document.getElementById('__react-content'));
90+
export default Example;

0 commit comments

Comments
 (0)