Skip to content

Commit

Permalink
upgrade eslint-config-airbnb
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Oct 9, 2017
1 parent 8ccd021 commit 475e4ff
Show file tree
Hide file tree
Showing 47 changed files with 394 additions and 352 deletions.
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const eslintrc = {
'import/extensions': 0,
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': 0,
'prefer-destructuring': 0,
'no-param-reassign': 0,
'no-return-assign': 0,
'max-len': 0,
Expand All @@ -38,8 +39,13 @@ const eslintrc = {
'react/require-extension': 0,
'jsx-a11y/no-static-element-interactions': 0,
'jsx-a11y/anchor-has-content': 0,
'jsx-a11y/click-events-have-key-events': 0,
'jsx-a11y/anchor-is-valid': 0,
'react/no-danger': 0,
'comma-dangle': ['error', 'always-multiline'],
'function-paren-newline': 0,
'object-curly-newline': 0,
'no-restricted-globals': 0,
},
};

Expand All @@ -51,6 +57,7 @@ if (process.env.RUN_ENV === 'DEMO') {
};

Object.assign(eslintrc.rules, {
indent: 0,
'no-console': 0,
'no-plusplus': 0,
'eol-last': 0,
Expand Down
38 changes: 20 additions & 18 deletions components/affix/__tests__/Affix.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,32 @@ class AffixMounter extends React.Component {
return this.container;
}
render() {
return (<div
style={{
height: 100,
overflowY: 'scroll',
}}
ref={(node) => { this.container = node; }}
>
return (
<div
className="background"
style={{
paddingTop: 60,
height: 300,
height: 100,
overflowY: 'scroll',
}}
ref={(node) => { this.container = node; }}
>
<Affix
target={() => this.container}
ref={ele => this.affix = ele}
<div
className="background"
style={{
paddingTop: 60,
height: 300,
}}
>
<Button type="primary" >
Fixed at the top of container
</Button>
</Affix>
<Affix
target={() => this.container}
ref={ele => this.affix = ele}
>
<Button type="primary" >
Fixed at the top of container
</Button>
</Affix>
</div>
</div>
</div>);
);
}
}

Expand Down
30 changes: 17 additions & 13 deletions components/alert/demo/closable.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,21 @@ const onClose = function (e) {
console.log(e, 'I was closed.');
};

ReactDOM.render(<div>
<Alert message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
type="warning"
closable
onClose={onClose}
/>
<Alert message="Error Text"
description="Error Description Error Description Error Description Error Description Error Description Error Description"
type="error"
closable
onClose={onClose}
/>
</div>, mountNode);
ReactDOM.render(
<div>
<Alert
message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
type="warning"
closable
onClose={onClose}
/>
<Alert
message="Error Text"
description="Error Description Error Description Error Description Error Description Error Description Error Description"
type="error"
closable
onClose={onClose}
/>
</div>
, mountNode);
````
46 changes: 24 additions & 22 deletions components/alert/demo/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,28 @@ Additional description for alert message.
````jsx
import { Alert } from 'antd';

ReactDOM.render(<div>
<Alert
message="Success Text"
description="Success Description Success Description Success Description"
type="success"
/>
<Alert
message="Info Text"
description="Info Description Info Description Info Description Info Description"
type="info"
/>
<Alert
message="Warning Text"
description="Warning Description Warning Description Warning Description Warning Description"
type="warning"
/>
<Alert
message="Error Text"
description="Error Description Error Description Error Description Error Description"
type="error"
/>
</div>, mountNode);
ReactDOM.render(
<div>
<Alert
message="Success Text"
description="Success Description Success Description Success Description"
type="success"
/>
<Alert
message="Info Text"
description="Info Description Info Description Info Description Info Description"
type="info"
/>
<Alert
message="Warning Text"
description="Warning Description Warning Description Warning Description Warning Description"
type="warning"
/>
<Alert
message="Error Text"
description="Error Description Error Description Error Description Error Description"
type="error"
/>
</div>
, mountNode);
````
62 changes: 32 additions & 30 deletions components/alert/demo/icon.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,36 @@ Decent icon make information more clear and more friendly.
````jsx
import { Alert } from 'antd';

ReactDOM.render(<div>
<Alert message="Success Tips" type="success" showIcon />
<Alert message="Informational Notes" type="info" showIcon />
<Alert message="Warning" type="warning" showIcon />
<Alert message="Error" type="error" showIcon />
<Alert
message="success tips"
description="Detailed description and advices about successful copywriting."
type="success"
showIcon
/>
<Alert
message="Informational Notes"
description="Additional description and informations about copywriting."
type="info"
showIcon
/>
<Alert
message="Warning"
description="This is a warning notice about copywriting."
type="warning"
showIcon
/>
<Alert
message="Error"
description="This is an error message about copywriting."
type="error"
showIcon
/>
</div>, mountNode);
ReactDOM.render(
<div>
<Alert message="Success Tips" type="success" showIcon />
<Alert message="Informational Notes" type="info" showIcon />
<Alert message="Warning" type="warning" showIcon />
<Alert message="Error" type="error" showIcon />
<Alert
message="success tips"
description="Detailed description and advices about successful copywriting."
type="success"
showIcon
/>
<Alert
message="Informational Notes"
description="Additional description and informations about copywriting."
type="info"
showIcon
/>
<Alert
message="Warning"
description="This is a warning notice about copywriting."
type="warning"
showIcon
/>
<Alert
message="Error"
description="This is an error message about copywriting."
type="error"
showIcon
/>
</div>
, mountNode);
````
14 changes: 8 additions & 6 deletions components/alert/demo/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ There are 4 types of Alert: `success`, `info`, `warning`, `error`.
````jsx
import { Alert } from 'antd';

ReactDOM.render(<div>
<Alert message="Success Text" type="success" />
<Alert message="Info Text" type="info" />
<Alert message="Warning Text" type="warning" />
<Alert message="Error Text" type="error" />
</div>, mountNode);
ReactDOM.render(
<div>
<Alert message="Success Text" type="success" />
<Alert message="Info Text" type="info" />
<Alert message="Warning Text" type="warning" />
<Alert message="Error Text" type="error" />
</div>
, mountNode);
````
10 changes: 6 additions & 4 deletions components/calendar/demo/notice-calendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ function getMonthData(value) {

function monthCellRender(value) {
const num = getMonthData(value);
return num ? <div className="notes-month">
<section>{num}</section>
<span>Backlog number</span>
</div> : null;
return num ? (
<div className="notes-month">
<section>{num}</section>
<span>Backlog number</span>
</div>
) : null;
}

ReactDOM.render(
Expand Down
2 changes: 1 addition & 1 deletion components/carousel/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Carousel from '..';
describe('Carousel', () => {
it('should has innerSlider', () => {
const wrapper = mount(<Carousel><div /></Carousel>);
const innerSlider = wrapper.node.innerSlider;
const { innerSlider } = wrapper.node;
const innerSliderFromRefs = wrapper.node.refs.slick.innerSlider;
expect(innerSlider).toBe(innerSliderFromRefs);
expect(typeof innerSlider.slickNext).toBe('function');
Expand Down
4 changes: 0 additions & 4 deletions components/cascader/demo/lazy.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@ const options = [{

class LazyOptions extends React.Component {
state = {
inputValue: '',
options,
};
onChange = (value, selectedOptions) => {
console.log(value, selectedOptions);
this.setState({
inputValue: selectedOptions.map(o => o.label).join(', '),
});
}
loadData = (selectedOptions) => {
const targetOption = selectedOptions[selectedOptions.length - 1];
Expand Down
8 changes: 4 additions & 4 deletions components/collapse/demo/accordion.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
order: 1
title:
title:
zh-CN: 手风琴
en-US: Accordion
---
Expand All @@ -25,13 +25,13 @@ const text = `

ReactDOM.render(
<Collapse accordion>
<Panel header={'This is panel header 1'} key="1">
<Panel header="This is panel header 1" key="1">
<p>{text}</p>
</Panel>
<Panel header={'This is panel header 2'} key="2">
<Panel header="This is panel header 2" key="2">
<p>{text}</p>
</Panel>
<Panel header={'This is panel header 3'} key="3">
<Panel header="This is panel header 3" key="3">
<p>{text}</p>
</Panel>
</Collapse>
Expand Down
8 changes: 4 additions & 4 deletions components/collapse/demo/mix.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ const text = `

ReactDOM.render(
<Collapse onChange={callback}>
<Panel header={'This is panel header 1'} key="1">
<Panel header="This is panel header 1" key="1">
<Collapse defaultActiveKey="1">
<Panel header={'This is panel nest panel'} key="1">
<Panel header="This is panel nest panel" key="1">
<p>{text}</p>
</Panel>
</Collapse>
</Panel>
<Panel header={'This is panel header 2'} key="2">
<Panel header="This is panel header 2" key="2">
<p>{text}</p>
</Panel>
<Panel header={'This is panel header 3'} key="3">
<Panel header="This is panel header 3" key="3">
<p>{text}</p>
</Panel>
</Collapse>
Expand Down
4 changes: 2 additions & 2 deletions components/dropdown/demo/trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ const menu = (
</Menu>
);

ReactDOM.render(<div>
ReactDOM.render(
<Dropdown overlay={menu} trigger={['click']}>
<a className="ant-dropdown-link" href="#">
Click me <Icon type="down" />
</a>
</Dropdown>
</div>, mountNode);
, mountNode);
````
Loading

0 comments on commit 475e4ff

Please sign in to comment.