mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
chore(deps): update dependency eslint to v8 (#32501)
* chore(deps): update dependency eslint to v8 * fix eslint errors * fix eslint errors Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
parent
94b21979e0
commit
14fa342da3
@ -70,6 +70,7 @@ module.exports = {
|
|||||||
'no-script-url': 0,
|
'no-script-url': 0,
|
||||||
'prefer-rest-params': 0,
|
'prefer-rest-params': 0,
|
||||||
'compat/compat': 0,
|
'compat/compat': 0,
|
||||||
|
'class-methods-use-this': 0,
|
||||||
'react/no-access-state-in-setstate': 0,
|
'react/no-access-state-in-setstate': 0,
|
||||||
'react/destructuring-assignment': 0,
|
'react/destructuring-assignment': 0,
|
||||||
'react/no-multi-comp': 0,
|
'react/no-multi-comp': 0,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable class-methods-use-this */
|
||||||
import raf from 'rc-util/lib/raf';
|
import raf from 'rc-util/lib/raf';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
@ -43,7 +44,6 @@ describe('Test utils function', () => {
|
|||||||
const callbackFn = jest.fn();
|
const callbackFn = jest.fn();
|
||||||
class Test {
|
class Test {
|
||||||
@throttleByAnimationFrameDecorator()
|
@throttleByAnimationFrameDecorator()
|
||||||
// eslint-disable-next-line class-methods-use-this
|
|
||||||
callback() {
|
callback() {
|
||||||
callbackFn();
|
callbackFn();
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ describe('ConfigProvider.Locale', () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line class-methods-use-this
|
||||||
openConfirm = () => {
|
openConfirm = () => {
|
||||||
jest.useFakeTimers();
|
jest.useFakeTimers();
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
|
@ -80,6 +80,7 @@ class Countdown extends React.Component<CountdownProps, {}> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Countdown do not need display the timestamp
|
// Countdown do not need display the timestamp
|
||||||
|
// eslint-disable-next-line class-methods-use-this
|
||||||
valueRender = (node: React.ReactElement<HTMLDivElement>) =>
|
valueRender = (node: React.ReactElement<HTMLDivElement>) =>
|
||||||
cloneElement(node, {
|
cloneElement(node, {
|
||||||
title: undefined,
|
title: undefined,
|
||||||
|
@ -300,6 +300,7 @@ class Transfer<RecordType extends TransferItem = TransferItem> extends React.Com
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line class-methods-use-this
|
||||||
handleListStyle = (
|
handleListStyle = (
|
||||||
listStyle: TransferProps<RecordType>['listStyle'],
|
listStyle: TransferProps<RecordType>['listStyle'],
|
||||||
direction: TransferDirection,
|
direction: TransferDirection,
|
||||||
|
@ -163,8 +163,6 @@ export default class TransferList<
|
|||||||
return text.indexOf(filterValue) >= 0;
|
return text.indexOf(filterValue) >= 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
getCurrentPageItems = () => {};
|
|
||||||
|
|
||||||
// =============================== Render ===============================
|
// =============================== Render ===============================
|
||||||
renderListBody = (
|
renderListBody = (
|
||||||
renderList: RenderListFunction<RecordType> | undefined,
|
renderList: RenderListFunction<RecordType> | undefined,
|
||||||
|
@ -198,7 +198,7 @@
|
|||||||
"enzyme": "^3.10.0",
|
"enzyme": "^3.10.0",
|
||||||
"enzyme-to-json": "^3.6.0",
|
"enzyme-to-json": "^3.6.0",
|
||||||
"esbuild-loader": "^2.13.1",
|
"esbuild-loader": "^2.13.1",
|
||||||
"eslint": "^7.9.0",
|
"eslint": "^8.0.0",
|
||||||
"eslint-config-airbnb": "^18.0.0",
|
"eslint-config-airbnb": "^18.0.0",
|
||||||
"eslint-config-prettier": "^8.0.0",
|
"eslint-config-prettier": "^8.0.0",
|
||||||
"eslint-plugin-babel": "^5.3.0",
|
"eslint-plugin-babel": "^5.3.0",
|
||||||
|
@ -45,8 +45,9 @@ class Article extends React.Component<ArticleProps> {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line class-methods-use-this
|
||||||
onResourceClick: React.MouseEventHandler<HTMLAnchorElement> = event => {
|
onResourceClick: React.MouseEventHandler<HTMLAnchorElement> = event => {
|
||||||
const { target } = (event as unknown) as { target: HTMLAnchorElement };
|
const { target } = event as unknown as { target: HTMLAnchorElement };
|
||||||
if (!window.gtag) {
|
if (!window.gtag) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -166,4 +167,4 @@ class Article extends React.Component<ArticleProps> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (injectIntl(Article as any) as any) as React.ComponentClass<ArticleProps>;
|
export default injectIntl(Article as any) as any as React.ComponentClass<ArticleProps>;
|
||||||
|
@ -95,6 +95,7 @@ class PicSearcher extends Component<PicSearcherProps, PicSearcherState> {
|
|||||||
reader.readAsDataURL(file);
|
reader.readAsDataURL(file);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line class-methods-use-this
|
||||||
toImage = (url: any) =>
|
toImage = (url: any) =>
|
||||||
new Promise(resolve => {
|
new Promise(resolve => {
|
||||||
const img = new Image();
|
const img = new Image();
|
||||||
@ -133,6 +134,7 @@ class PicSearcher extends Component<PicSearcherProps, PicSearcherState> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line class-methods-use-this
|
||||||
onCopied = (text: string) => {
|
onCopied = (text: string) => {
|
||||||
message.success(
|
message.success(
|
||||||
<span>
|
<span>
|
||||||
@ -145,15 +147,8 @@ class PicSearcher extends Component<PicSearcherProps, PicSearcherState> {
|
|||||||
const {
|
const {
|
||||||
intl: { messages },
|
intl: { messages },
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const {
|
const { modalVisible, popoverVisible, icons, fileList, loading, modelLoaded, error } =
|
||||||
modalVisible,
|
this.state;
|
||||||
popoverVisible,
|
|
||||||
icons,
|
|
||||||
fileList,
|
|
||||||
loading,
|
|
||||||
modelLoaded,
|
|
||||||
error,
|
|
||||||
} = this.state;
|
|
||||||
return (
|
return (
|
||||||
<div className="icon-pic-searcher">
|
<div className="icon-pic-searcher">
|
||||||
<Popover
|
<Popover
|
||||||
|
@ -173,6 +173,7 @@ class Header extends React.Component<HeaderProps, HeaderState> {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line class-methods-use-this
|
||||||
handleVersionChange = (url: string) => {
|
handleVersionChange = (url: string) => {
|
||||||
const currentUrl = window.location.href;
|
const currentUrl = window.location.href;
|
||||||
const currentPathname = window.location.pathname;
|
const currentPathname = window.location.pathname;
|
||||||
|
Loading…
Reference in New Issue
Block a user