Commit 804969cf authored by duanledexianxianxian's avatar duanledexianxianxian 😁

fix:eslint报错

parent dbbaccad
......@@ -4,6 +4,13 @@ module.exports = {
...fabric.default,
rules: {
...fabric.default.rules,
'import/no-extraneous-dependencies': [
2,
{
optionalDependencies: true,
devDependencies: ['**/tests/**.js', '/mock/**/**.js', '**/**.test.js', '**/**._mock.js'],
},
],
},
globals: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
......
......@@ -34,6 +34,7 @@
},
"husky": {
"hooks": {
"pre-commit": "npm run lint-staged"
}
},
"lint-staged": {
......@@ -102,7 +103,7 @@
"@types/react-document-title": "^2.0.3",
"@types/react-dom": "^16.8.4",
"@types/numeral":"^0.0.25",
"@umijs/fabric": "^1.0.4",
"@umijs/fabric": "^1.0.5",
"babel-eslint": "^10.0.1",
"chalk": "^2.4.2",
"check-prettier": "^1.0.3",
......@@ -120,14 +121,15 @@
"jest-puppeteer": "^4.2.0",
"jsdom-global": "^3.0.2",
"lint-staged": "^8.1.7",
"mockjs": "^1.0.1-beta3",
"netlify-lambda": "^1.4.13",
"node-fetch": "^2.6.0",
"prettier": "^1.17.1",
"serverless-http": "^2.0.2",
"slash2": "^2.0.0",
"stylelint": "^10.1.0",
"webpack-theme-color-replacer": "^1.1.5"
"webpack-theme-color-replacer": "^1.1.5",
"mockjs": "^1.0.1-beta3",
"@types/mockjs":"^1.0.2"
},
"optionalDependencies": {
"puppeteer": "^1.17.0"
......
......@@ -40,12 +40,12 @@ const operationTabList = [
},
];
interface accountCenterProps extends RouteChildrenProps {
interface AccountCenterProps extends RouteChildrenProps {
dispatch: Dispatch<any>;
currentUser: CurrentUser;
currentUserLoading: boolean;
}
interface accountCenterState {
interface AccountCenterState {
newTags: TagType[];
tabKey: 'articles' | 'applications' | 'projects';
inputVisible: boolean;
......@@ -64,10 +64,7 @@ interface accountCenterState {
currentUserLoading: loading.effects['accountCenter/fetchCurrent'],
}),
)
class Center extends PureComponent<
accountCenterProps,
accountCenterState
> {
class Center extends PureComponent<AccountCenterProps, AccountCenterState> {
// static getDerivedStateFromProps(
// props: accountCenterProps,
// state: accountCenterState,
......@@ -86,7 +83,7 @@ class Center extends PureComponent<
// return null;
// }
state: accountCenterState = {
state: AccountCenterState = {
newTags: [],
inputVisible: false,
inputValue: '',
......
......@@ -17,13 +17,13 @@ const TopSearch = React.lazy(() => import('./components/TopSearch'));
const ProportionSales = React.lazy(() => import('./components/ProportionSales'));
const OfflineData = React.lazy(() => import('./components/OfflineData'));
interface dashboardAnalysisProps {
interface DashboardAnalysisProps {
dashboardAnalysis: AnalysisData;
dispatch: Dispatch<any>;
loading: boolean;
}
interface dashboardAnalysisState {
interface DashboardAnalysisState {
salesType: 'all' | 'online' | 'stores';
currentTabKey: string;
rangePickerValue: RangePickerValue;
......@@ -43,11 +43,8 @@ interface dashboardAnalysisState {
loading: loading.effects['dashboardAnalysis/fetch'],
}),
)
class Analysis extends Component<
dashboardAnalysisProps,
dashboardAnalysisState
> {
state: dashboardAnalysisState = {
class Analysis extends Component<DashboardAnalysisProps, DashboardAnalysisState> {
state: DashboardAnalysisState = {
salesType: 'all',
currentTabKey: '',
rangePickerValue: getTimeDistance('year'),
......
......@@ -39,7 +39,7 @@ const links = [
},
];
interface dashboardWorkplaceProps {
interface DashboardWorkplaceProps {
currentUser: CurrentUser;
projectNotice: NoticeType[];
activities: ActivitiesType[];
......@@ -67,7 +67,7 @@ interface dashboardWorkplaceProps {
activitiesLoading: loading.effects['dashboardWorkplace/fetchActivitiesList'],
}),
)
class Workplace extends PureComponent<dashboardWorkplaceProps> {
class Workplace extends PureComponent<DashboardWorkplaceProps> {
componentDidMount() {
const { dispatch } = this.props;
dispatch({
......
......@@ -42,12 +42,12 @@ const passwordProgressMap: {
poor: 'exception',
};
interface userRegisterProps extends FormComponentProps {
interface UserRegisterProps extends FormComponentProps {
dispatch: Dispatch<any>;
userRegister: StateType;
submitting: boolean;
}
interface userRegisterState {
interface UserRegisterState {
count: number;
confirmDirty: boolean;
visible: boolean;
......@@ -80,11 +80,8 @@ export interface UserRegisterParams {
submitting: loading.effects['userRegister/submit'],
}),
)
class Register extends Component<
userRegisterProps,
userRegisterState
> {
state: userRegisterState = {
class Register extends Component<UserRegisterProps, UserRegisterState> {
state: UserRegisterState = {
count: 0,
confirmDirty: false,
visible: false,
......@@ -342,7 +339,9 @@ class Register extends Component<
})(
<Input
size="large"
placeholder={formatMessage({ id: 'user-register.verification-code.placeholder' })}
placeholder={formatMessage({
id: 'user-register.verification-code.placeholder',
})}
/>,
)}
</Col>
......@@ -380,4 +379,4 @@ class Register extends Component<
}
}
export default Form.create<userRegisterProps>()(Register);
export default Form.create<UserRegisterProps>()(Register);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment