From 31efd937313324ee6633583ed20a3355d8976ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Fri, 28 Jun 2019 14:55:57 +0800 Subject: [PATCH] Upgrade scaffolding fix #4637, ci is hung up up deps --- .eslintrc.js | 7 ++----- package.json | 12 +++++------- src/components/GlobalHeader/AvatarDropdown.tsx | 6 +++--- src/components/GlobalHeader/NoticeIconView.tsx | 10 +++++----- src/components/GlobalHeader/RightContent.tsx | 8 ++++---- src/layouts/UserLayout.tsx | 6 +++--- src/models/global.ts | 5 +++-- src/models/setting.ts | 2 -- src/models/user.ts | 4 ++-- src/pages/Authorized.tsx | 5 ++--- src/typings.d.ts | 1 - 11 files changed, 29 insertions(+), 37 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index a2551389..929f3ee8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,10 +1,7 @@ -const fabric = require('@umijs/fabric'); +const { strictEslint } = require('@umijs/fabric'); module.exports = { - ...fabric.default, - rules: { - ...fabric.default.rules, - }, + ...strictEslint, globals: { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true, page: true, diff --git a/package.json b/package.json index 36d0bfae..2679827b 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "not ie <= 10" ], "dependencies": { - "@ant-design/pro-layout": "^4.5.0", + "@ant-design/pro-layout": "^4.5.7", "@antv/data-set": "^0.10.2", "antd": "^3.19.1", "classnames": "^2.2.6", @@ -67,7 +67,6 @@ "path-to-regexp": "^3.0.0", "prop-types": "^15.7.2", "qs": "^6.7.0", - "rc-animate": "^2.8.3", "react": "^16.8.6", "react-container-query": "^0.11.0", "react-copy-to-clipboard": "^5.0.1", @@ -76,10 +75,10 @@ "react-media": "^1.9.2", "react-media-hook2": "^1.0.5", "redux": "^4.0.1", - "umi": "^2.7.2", + "umi": "^2.8.7", "umi-plugin-pro-block": "^1.3.2", - "umi-plugin-react": "^1.8.2", - "umi-request": "^1.0.7" + "umi-plugin-react": "^1.9.5", + "umi-request": "^1.0.8" }, "devDependencies": { "@ant-design/colors": "^3.1.0", @@ -91,8 +90,7 @@ "@types/react": "^16.8.19", "@types/react-document-title": "^2.0.3", "@types/react-dom": "^16.8.4", - "@umijs/fabric": "^1.0.4", - "babel-eslint": "^10.0.1", + "@umijs/fabric": "^1.1.0", "chalk": "^2.4.2", "check-prettier": "^1.0.3", "cross-env": "^5.2.0", diff --git a/src/components/GlobalHeader/AvatarDropdown.tsx b/src/components/GlobalHeader/AvatarDropdown.tsx index d2338043..ccdb7494 100644 --- a/src/components/GlobalHeader/AvatarDropdown.tsx +++ b/src/components/GlobalHeader/AvatarDropdown.tsx @@ -1,12 +1,12 @@ import { Avatar, Icon, Menu, Spin } from 'antd'; -import { ConnectProps, ConnectState } from '@/models/connect'; - import { ClickParam } from 'antd/es/menu'; -import { CurrentUser } from '@/models/user'; import { FormattedMessage } from 'umi-plugin-react/locale'; import React from 'react'; import { connect } from 'dva'; import router from 'umi/router'; + +import { ConnectProps, ConnectState } from '@/models/connect'; +import { CurrentUser } from '@/models/user'; import HeaderDropdown from '../HeaderDropdown'; import styles from './index.less'; diff --git a/src/components/GlobalHeader/NoticeIconView.tsx b/src/components/GlobalHeader/NoticeIconView.tsx index 52a26e8a..0f019060 100644 --- a/src/components/GlobalHeader/NoticeIconView.tsx +++ b/src/components/GlobalHeader/NoticeIconView.tsx @@ -1,14 +1,14 @@ -import { ConnectProps, ConnectState } from '@/models/connect'; import React, { Component } from 'react'; import { Tag, message } from 'antd'; - -import { CurrentUser } from '@/models/user'; -import NoticeIcon from '../NoticeIcon'; -import { NoticeItem } from '@/models/global'; import { connect } from 'dva'; import { formatMessage } from 'umi-plugin-react/locale'; import groupBy from 'lodash/groupBy'; import moment from 'moment'; + +import { NoticeItem } from '@/models/global'; +import NoticeIcon from '../NoticeIcon'; +import { CurrentUser } from '@/models/user'; +import { ConnectProps, ConnectState } from '@/models/connect'; import styles from './index.less'; export interface GlobalHeaderRightProps extends ConnectProps { diff --git a/src/components/GlobalHeader/RightContent.tsx b/src/components/GlobalHeader/RightContent.tsx index 9200785d..3516fc56 100644 --- a/src/components/GlobalHeader/RightContent.tsx +++ b/src/components/GlobalHeader/RightContent.tsx @@ -1,12 +1,12 @@ -import { ConnectProps, ConnectState } from '@/models/connect'; import { Icon, Tooltip } from 'antd'; +import React from 'react'; +import { connect } from 'dva'; +import { formatMessage } from 'umi-plugin-react/locale'; +import { ConnectProps, ConnectState } from '@/models/connect'; import Avatar from './AvatarDropdown'; import HeaderSearch from '../HeaderSearch'; -import React from 'react'; import SelectLang from '../SelectLang'; -import { connect } from 'dva'; -import { formatMessage } from 'umi-plugin-react/locale'; import styles from './index.less'; export type SiderTheme = 'light' | 'dark'; diff --git a/src/layouts/UserLayout.tsx b/src/layouts/UserLayout.tsx index 30397dd3..6a792ff2 100644 --- a/src/layouts/UserLayout.tsx +++ b/src/layouts/UserLayout.tsx @@ -1,12 +1,12 @@ -import { ConnectProps, ConnectState } from '@/models/connect'; import { DefaultFooter, MenuDataItem, getMenuData, getPageTitle } from '@ant-design/pro-layout'; - import DocumentTitle from 'react-document-title'; import Link from 'umi/link'; import React from 'react'; -import SelectLang from '@/components/SelectLang'; import { connect } from 'dva'; import { formatMessage } from 'umi-plugin-react/locale'; + +import SelectLang from '@/components/SelectLang'; +import { ConnectProps, ConnectState } from '@/models/connect'; import logo from '../assets/logo.svg'; import styles from './UserLayout.less'; diff --git a/src/models/global.ts b/src/models/global.ts index a79cac67..0142139d 100644 --- a/src/models/global.ts +++ b/src/models/global.ts @@ -1,7 +1,8 @@ -import { Effect } from './connect.d'; -import { NoticeIconData } from '@/components/NoticeIcon'; import { Reducer } from 'redux'; import { Subscription } from 'dva'; + +import { Effect } from './connect.d'; +import { NoticeIconData } from '@/components/NoticeIcon'; import { queryNotices } from '@/services/user'; export interface NoticeItem extends NoticeIconData { diff --git a/src/models/setting.ts b/src/models/setting.ts index 2e52eb54..860b9dd6 100644 --- a/src/models/setting.ts +++ b/src/models/setting.ts @@ -1,6 +1,4 @@ import { Reducer } from 'redux'; -// eslint-disable-next-line eslint-comments/disable-enable-pair -/* eslint-disable promise/catch-or-return */ import { message } from 'antd'; import defaultSettings, { DefaultSettings } from '../../config/defaultSettings'; import themeColorClient from '../components/SettingDrawer/themeColorClient'; diff --git a/src/models/user.ts b/src/models/user.ts index 426ff9aa..54bde7a5 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -1,8 +1,8 @@ -import { queryCurrent, query as queryUsers } from '@/services/user'; - import { Effect } from 'dva'; import { Reducer } from 'redux'; +import { queryCurrent, query as queryUsers } from '@/services/user'; + export interface CurrentUser { avatar?: string; name?: string; diff --git a/src/pages/Authorized.tsx b/src/pages/Authorized.tsx index 1bfd8267..54976111 100644 --- a/src/pages/Authorized.tsx +++ b/src/pages/Authorized.tsx @@ -1,10 +1,9 @@ -import { ConnectProps, ConnectState, Route, UserModelState } from '@/models/connect'; - -import Authorized from '@/utils/Authorized'; import React from 'react'; import Redirect from 'umi/redirect'; import { connect } from 'dva'; import pathToRegexp from 'path-to-regexp'; +import Authorized from '@/utils/Authorized'; +import { ConnectProps, ConnectState, Route, UserModelState } from '@/models/connect'; interface AuthComponentProps extends ConnectProps { user: UserModelState; diff --git a/src/typings.d.ts b/src/typings.d.ts index fff79b43..1815fe62 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -12,7 +12,6 @@ declare module '*.jpeg'; declare module '*.gif'; declare module '*.bmp'; declare module '*.tiff'; -declare module 'rc-animate'; declare module 'omit.js'; declare module 'react-copy-to-clipboard'; declare module 'react-fittext'; -- GitLab