🆙 upgrade eslint-config-airbnb

This commit is contained in:
afc163 2019-08-11 16:38:04 +08:00
parent 090afe0402
commit 2bddeef1e5
6 changed files with 12 additions and 6 deletions

View File

@ -56,6 +56,8 @@ const eslintrc = {
'jsx-a11y/anchor-is-valid': 0, 'jsx-a11y/anchor-is-valid': 0,
'comma-dangle': ['error', 'always-multiline'], 'comma-dangle': ['error', 'always-multiline'],
'react/jsx-filename-extension': 0, 'react/jsx-filename-extension': 0,
'react/state-in-constructor': 0,
'react/jsx-props-no-spreading': 0,
'prefer-destructuring': 0, // TODO: remove later 'prefer-destructuring': 0, // TODO: remove later
'consistent-return': 0, // TODO: remove later 'consistent-return': 0, // TODO: remove later
'no-return-assign': 0, // TODO: remove later 'no-return-assign': 0, // TODO: remove later
@ -78,6 +80,8 @@ const eslintrc = {
'react/display-name': 0, 'react/display-name': 0,
// ban this for Number.isNaN needs polyfill // ban this for Number.isNaN needs polyfill
'no-restricted-globals': 0, 'no-restricted-globals': 0,
'max-classes-per-file': 0,
'react/static-property-placement': 0,
}, },
}; };

View File

@ -143,7 +143,7 @@ describe('Test utils function', () => {
it('bindAnimationEvent should return when node is null', () => { it('bindAnimationEvent should return when node is null', () => {
const wrapper = mount( const wrapper = mount(
<Wave> <Wave>
<button type="button" disabled /> <button type="button" disabled>button</button>
</Wave>, </Wave>,
).instance(); ).instance();
expect(wrapper.bindAnimationEvent()).toBe(undefined); expect(wrapper.bindAnimationEvent()).toBe(undefined);
@ -152,7 +152,7 @@ describe('Test utils function', () => {
it('bindAnimationEvent.onClick should return when children is hidden', () => { it('bindAnimationEvent.onClick should return when children is hidden', () => {
const wrapper = mount( const wrapper = mount(
<Wave> <Wave>
<button type="button" style={{ display: 'none' }} /> <button type="button" style={{ display: 'none' }}>button</button>
</Wave>, </Wave>,
).instance(); ).instance();
expect(wrapper.bindAnimationEvent()).toBe(undefined); expect(wrapper.bindAnimationEvent()).toBe(undefined);

View File

@ -2907,7 +2907,9 @@ exports[`Badge should support offset when count is a ReactNode 1`] = `
<a <a
class="head-example" class="head-example"
href="#" href="#"
/> >
head
</a>
<span <span
class="ant-scroll-number-custom-component custom" class="ant-scroll-number-custom-component custom"
style="right:-10px;margin-top:20px;color:#f5222d" style="right:-10px;margin-top:20px;color:#f5222d"

View File

@ -84,7 +84,7 @@ describe('Badge', () => {
it('should support offset when count is a ReactNode', () => { it('should support offset when count is a ReactNode', () => {
const wrapper = render( const wrapper = render(
<Badge count={<span className="custom" style={{ color: '#f5222d' }} />} offset={[10, 20]}> <Badge count={<span className="custom" style={{ color: '#f5222d' }} />} offset={[10, 20]}>
<a href="#" className="head-example" /> <a href="#" className="head-example">head</a>
</Badge>, </Badge>,
); );
expect(wrapper).toMatchSnapshot(); expect(wrapper).toMatchSnapshot();

View File

@ -521,7 +521,7 @@ describe('Upload List', () => {
const wrapper = mount( const wrapper = mount(
<Upload listType="picture" defaultFileList={[file]} previewFile={previewFile}> <Upload listType="picture" defaultFileList={[file]} previewFile={previewFile}>
<button type="button" /> <button type="button">button</button>
</Upload>, </Upload>,
); );
wrapper.setState({}); wrapper.setState({});

View File

@ -126,7 +126,7 @@
"enzyme-adapter-react-16": "^1.14.0", "enzyme-adapter-react-16": "^1.14.0",
"enzyme-to-json": "^3.3.5", "enzyme-to-json": "^3.3.5",
"eslint": "^6.1.0", "eslint": "^6.1.0",
"eslint-config-airbnb": "^17.1.0", "eslint-config-airbnb": "^18.0.0",
"eslint-config-prettier": "^6.0.0", "eslint-config-prettier": "^6.0.0",
"eslint-plugin-babel": "^5.3.0", "eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.17.3", "eslint-plugin-import": "^2.17.3",