Browse Source

🆙 upgrade eslint-config-airbnb

pull/18209/head
afc163 5 years ago
parent
commit
2bddeef1e5
  1. 4
      .eslintrc.js
  2. 4
      components/_util/__tests__/util.test.js
  3. 4
      components/badge/__tests__/__snapshots__/index.test.js.snap
  4. 2
      components/badge/__tests__/index.test.js
  5. 2
      components/upload/__tests__/uploadlist.test.js
  6. 2
      package.json

4
.eslintrc.js

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

4
components/_util/__tests__/util.test.js

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

4
components/badge/__tests__/__snapshots__/index.test.js.snap

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

2
components/badge/__tests__/index.test.js

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

2
components/upload/__tests__/uploadlist.test.js

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

2
package.json

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

Loading…
Cancel
Save