Commit 804969cf authored by duanledexianxianxian's avatar duanledexianxianxian 😁

fix:eslint报错

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