Skip to content

Commit

Permalink
chore: add prettier ignore and format demo (ant-design#27270)
Browse files Browse the repository at this point in the history
  • Loading branch information
hengkx authored Oct 21, 2020
1 parent b5dc079 commit 0822ac6
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 82 deletions.
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
**/*.png
**/*.svg
CODEOWNERS
.dockerignore
Dockerfile.ui-test
package.json
.umi
.umi-production
Expand All @@ -17,6 +21,8 @@ yarn-error.log
*.snap
components/*/*.js
components/*/*.jsx
components/*/*.md
docs/**/*.md
.gitignore
.npmignore
.prettierignore
Expand Down
7 changes: 2 additions & 5 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.
Use this section to tell people about which versions of your project are currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
Expand All @@ -14,6 +13,4 @@ currently being supported with security updates.

Use this section to tell people how to report a vulnerability.

Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.
Tell them where to go, how often they can expect to get an update on a reported vulnerability, what to expect if the vulnerability is accepted or declined, etc.
4 changes: 1 addition & 3 deletions components/calendar/demo/customize-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ ReactDOM.render(
}
return (
<div style={{ padding: 8 }}>
<Typography.Title level={4}>
Custom header
</Typography.Title>
<Typography.Title level={4}>Custom header</Typography.Title>
<Row gutter={8}>
<Col>
<Radio.Group size="small" onChange={e => onTypeChange(e.target.value)} value={type}>
Expand Down
6 changes: 1 addition & 5 deletions components/cascader/demo/custom-dropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ function dropdownRender(menus) {
}

ReactDOM.render(
<Cascader
options={options}
dropdownRender={dropdownRender}
placeholder="Please select"
/>,
<Cascader options={options} dropdownRender={dropdownRender} placeholder="Please select" />,
mountNode,
);
```
24 changes: 4 additions & 20 deletions components/comment/demo/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,8 @@ const data = [
</p>
),
datetime: (
<Tooltip
title={moment()
.subtract(1, 'days')
.format('YYYY-MM-DD HH:mm:ss')}
>
<span>
{moment()
.subtract(1, 'days')
.fromNow()}
</span>
<Tooltip title={moment().subtract(1, 'days').format('YYYY-MM-DD HH:mm:ss')}>
<span>{moment().subtract(1, 'days').fromNow()}</span>
</Tooltip>
),
},
Expand All @@ -55,16 +47,8 @@ const data = [
</p>
),
datetime: (
<Tooltip
title={moment()
.subtract(2, 'days')
.format('YYYY-MM-DD HH:mm:ss')}
>
<span>
{moment()
.subtract(2, 'days')
.fromNow()}
</span>
<Tooltip title={moment().subtract(2, 'days').format('YYYY-MM-DD HH:mm:ss')}>
<span>{moment().subtract(2, 'days').fromNow()}</span>
</Tooltip>
),
},
Expand Down
12 changes: 6 additions & 6 deletions components/form/demo/control-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ const Demo = () => {

const onGenderChange = value => {
switch (value) {
case "male":
form.setFieldsValue({ note: "Hi, man!" });
case 'male':
form.setFieldsValue({ note: 'Hi, man!' });
return;
case "female":
form.setFieldsValue({ note: "Hi, lady!" });
case 'female':
form.setFieldsValue({ note: 'Hi, lady!' });
return;
case "other":
form.setFieldsValue({ note: "Hi there!" });
case 'other':
form.setFieldsValue({ note: 'Hi there!' });
return;
}
};
Expand Down
5 changes: 4 additions & 1 deletion components/form/demo/register.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ const RegistrationForm = () => {
name="agreement"
valuePropName="checked"
rules={[
{ validator:(_, value) => value ? Promise.resolve() : Promise.reject('Should accept agreement') },
{
validator: (_, value) =>
value ? Promise.resolve() : Promise.reject('Should accept agreement'),
},
]}
{...tailFormItemLayout}
>
Expand Down
8 changes: 2 additions & 6 deletions components/list/demo/grid-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const data = [
{
title: 'Title 5',
},
{
{
title: 'Title 6',
},
];
Expand All @@ -57,11 +57,7 @@ ReactDOM.render(
</>
)}
/>
<List
grid={{ gutter: 16, column: 4 }}
dataSource={data}
renderItem={() => <ListItem />}
/>
<List grid={{ gutter: 16, column: 4 }} dataSource={data} renderItem={() => <ListItem />} />
<List
grid={{ gutter: 16, column: 4 }}
dataSource={data}
Expand Down
4 changes: 1 addition & 3 deletions components/modal/demo/modal-render.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ class App extends React.Component {
render() {
return (
<>
<Button onClick={this.showModal}>
Open Draggable Modal
</Button>
<Button onClick={this.showModal}>Open Draggable Modal</Button>
<Modal
title={
<div
Expand Down
2 changes: 1 addition & 1 deletion components/modal/demo/width.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const App = () => {
</Modal>
</>
);
}
};

ReactDOM.render(<App />, mountNode);
```
13 changes: 5 additions & 8 deletions components/radio/demo/badge.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@ import { Radio, Badge } from 'antd';
ReactDOM.render(
<Radio.Group buttonStyle="solid">
<Badge count={1}>
<Radio.Button value={1}>
Click Me
</Radio.Button>
<Radio.Button value={1}>Click Me</Radio.Button>
</Badge>
<Badge count={2}>
<Radio.Button value={2}>
Not Me
</Radio.Button>
<Radio.Button value={2}>Not Me</Radio.Button>
</Badge>
</Radio.Group>
, mountNode);
</Radio.Group>,
mountNode,
);
```
5 changes: 1 addition & 4 deletions components/time-picker/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ function onChange(time, timeString) {
}

ReactDOM.render(
<TimePicker
onChange={onChange}
defaultOpenValue={moment('00:00:00', 'HH:mm:ss')}
/>,
<TimePicker onChange={onChange} defaultOpenValue={moment('00:00:00', 'HH:mm:ss')} />,
mountNode,
);
```
8 changes: 1 addition & 7 deletions components/time-picker/demo/disabled.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,5 @@ A disabled state of the `TimePicker`.
import { TimePicker } from 'antd';
import moment from 'moment';

ReactDOM.render(
<TimePicker
defaultValue={moment('12:08:23', 'HH:mm:ss')}
disabled
/>,
mountNode,
);
ReactDOM.render(<TimePicker defaultValue={moment('12:08:23', 'HH:mm:ss')} disabled />, mountNode);
```
8 changes: 1 addition & 7 deletions components/time-picker/demo/hide-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,5 @@ import moment from 'moment';

const format = 'HH:mm';

ReactDOM.render(
<TimePicker
defaultValue={moment('12:08', format)}
format={format}
/>,
mountNode,
);
ReactDOM.render(<TimePicker defaultValue={moment('12:08', format)} format={format} />, mountNode);
```
2 changes: 1 addition & 1 deletion components/time-picker/demo/value.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Demo = () => {
};

return <TimePicker value={value} onChange={onChange} />;
}
};

ReactDOM.render(<Demo />, mountNode);
```
4 changes: 1 addition & 3 deletions components/tree-select/demo/async.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ class Demo extends React.Component {
};

genTreeNode = (parentId, isLeaf = false) => {
const random = Math.random()
.toString(36)
.substring(2, 6);
const random = Math.random().toString(36).substring(2, 6);
return {
id: random,
pId: parentId,
Expand Down
2 changes: 1 addition & 1 deletion components/tree/demo/draggable.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Demo extends React.Component {
return callback(data[i], i, data);
}
if (data[i].children) {
loop(data[i].children, key, callback);
loop(data[i].children, key, callback);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion components/tree/demo/line.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const treeData = [
{ title: 'leaf', key: '0-1-0-1', icon: <CarryOutOutlined /> },
],
},
]
],
},
];

Expand Down

0 comments on commit 0822ac6

Please sign in to comment.