Skip to content

Commit

Permalink
feat:: add prettier-plugin-organize-imports prettier-plugin-packagejso
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed May 20, 2022
1 parent 78b2663 commit d827f8d
Show file tree
Hide file tree
Showing 91 changed files with 209 additions and 243 deletions.
2 changes: 1 addition & 1 deletion jsExample/src/components/Authorized/Authorized.jsx
@@ -1,5 +1,5 @@
import React from 'react';
import { Result } from 'antd';
import React from 'react';
import check from './CheckPermissions';

const Authorized = ({
Expand Down
3 changes: 1 addition & 2 deletions jsExample/src/components/Authorized/CheckPermissions.jsx
@@ -1,7 +1,6 @@
import React from 'react';
import { CURRENT } from './renderAuthorize'; // eslint-disable-next-line

import PromiseRender from './PromiseRender';
import { CURRENT } from './renderAuthorize'; // eslint-disable-next-line

/**
* 通用权限检查方法
Expand Down
2 changes: 1 addition & 1 deletion jsExample/src/components/Authorized/PromiseRender.jsx
@@ -1,6 +1,6 @@
import React from 'react';
import { Spin } from 'antd';
import isEqual from 'lodash/isEqual';
import React from 'react';
import { isComponentClass } from './Secured'; // eslint-disable-next-line

export default class PromiseRender extends React.Component {
Expand Down
2 changes: 1 addition & 1 deletion jsExample/src/components/Authorized/index.jsx
@@ -1,7 +1,7 @@
import Authorized from './Authorized';
import Secured from './Secured';
import check from './CheckPermissions';
import renderAuthorize from './renderAuthorize';
import Secured from './Secured';

Authorized.Secured = Secured;
Authorized.check = check;
Expand Down
2 changes: 1 addition & 1 deletion jsExample/src/components/GlobalHeader/AvatarDropdown.jsx
@@ -1,7 +1,7 @@
import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
import { Avatar, Menu, Spin } from 'antd';
import React from 'react';
import { history, connect } from 'umi';
import { connect, history } from 'umi';
import HeaderDropdown from '../HeaderDropdown';
import styles from './index.less';

Expand Down
6 changes: 3 additions & 3 deletions jsExample/src/components/GlobalHeader/NoticeIconView.jsx
@@ -1,8 +1,8 @@
import React, { Component } from 'react';
import { connect } from 'umi';
import { Tag, message } from 'antd';
import { message, Tag } from 'antd';
import groupBy from 'lodash/groupBy';
import moment from 'moment';
import React, { Component } from 'react';
import { connect } from 'umi';
import NoticeIcon from '../NoticeIcon';
import styles from './index.less';

Expand Down
4 changes: 2 additions & 2 deletions jsExample/src/components/GlobalHeader/RightContent.jsx
@@ -1,9 +1,9 @@
import { Tooltip, Tag } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { Tag, Tooltip } from 'antd';
import React from 'react';
import { connect, SelectLang } from 'umi';
import Avatar from './AvatarDropdown';
import HeaderSearch from '../HeaderSearch';
import Avatar from './AvatarDropdown';
import styles from './index.less';

const ENVTagColor = {
Expand Down
2 changes: 1 addition & 1 deletion jsExample/src/components/HeaderDropdown/index.jsx
@@ -1,6 +1,6 @@
import { Dropdown } from 'antd';
import React from 'react';
import classNames from 'classnames';
import React from 'react';
import styles from './index.less';

const HeaderDropdown = ({ overlayClassName: cls, ...restProps }) => (
Expand Down
2 changes: 1 addition & 1 deletion jsExample/src/components/HeaderSearch/index.jsx
@@ -1,8 +1,8 @@
import { SearchOutlined } from '@ant-design/icons';
import { AutoComplete, Input } from 'antd';
import classNames from 'classnames';
import useMergedState from 'rc-util/es/hooks/useMergedState';
import React, { useRef } from 'react';
import classNames from 'classnames';
import styles from './index.less';

const HeaderSearch = (props) => {
Expand Down
2 changes: 1 addition & 1 deletion jsExample/src/components/NoticeIcon/NoticeList.jsx
@@ -1,6 +1,6 @@
import { Avatar, List } from 'antd';
import React from 'react';
import classNames from 'classnames';
import React from 'react';
import styles from './NoticeList.less';

const NoticeList = ({
Expand Down
4 changes: 2 additions & 2 deletions jsExample/src/components/NoticeIcon/index.jsx
@@ -1,11 +1,11 @@
import { BellOutlined } from '@ant-design/icons';
import { Badge, Spin, Tabs } from 'antd';
import classNames from 'classnames';
import useMergedState from 'rc-util/es/hooks/useMergedState';
import React from 'react';
import classNames from 'classnames';
import NoticeList from './NoticeList';
import HeaderDropdown from '../HeaderDropdown';
import styles from './index.less';
import NoticeList from './NoticeList';

const { TabPane } = Tabs;

Expand Down
12 changes: 6 additions & 6 deletions jsExample/src/layouts/BasicLayout.jsx
Expand Up @@ -3,14 +3,14 @@
* You can view component api by:
* https://github.com/ant-design/ant-design-pro-layout
*/
import ProLayout, { DefaultFooter } from '@ant-design/pro-layout';
import React, { useEffect, useMemo, useRef } from 'react';
import { Link, useIntl, connect, history } from 'umi';
import { GithubOutlined } from '@ant-design/icons';
import { Result, Button } from 'antd';
import Authorized from '@/utils/Authorized';
import RightContent from '@/components/GlobalHeader/RightContent';
import Authorized from '@/utils/Authorized';
import { GithubOutlined } from '@ant-design/icons';
import ProLayout, { DefaultFooter } from '@ant-design/pro-layout';
import { getMatchMenu } from '@umijs/route-utils';
import { Button, Result } from 'antd';
import React, { useEffect, useMemo, useRef } from 'react';
import { connect, history, Link, useIntl } from 'umi';
import logo from '../assets/logo.svg';

const noMatch = (
Expand Down
4 changes: 2 additions & 2 deletions jsExample/src/layouts/SecurityLayout.jsx
@@ -1,7 +1,7 @@
import React from 'react';
import { PageLoading } from '@ant-design/pro-layout';
import { Redirect, connect } from 'umi';
import { stringify } from 'querystring';
import React from 'react';
import { connect, Redirect } from 'umi';

class SecurityLayout extends React.Component {
state = {
Expand Down
4 changes: 2 additions & 2 deletions jsExample/src/layouts/UserLayout.jsx
@@ -1,7 +1,7 @@
import { DefaultFooter, getMenuData, getPageTitle } from '@ant-design/pro-layout';
import { Helmet, HelmetProvider } from 'react-helmet-async';
import { Link, SelectLang, useIntl, connect, FormattedMessage } from 'umi';
import React from 'react';
import { Helmet, HelmetProvider } from 'react-helmet-async';
import { connect, FormattedMessage, Link, SelectLang, useIntl } from 'umi';
import logo from '../assets/logo.svg';
import styles from './UserLayout.less';

Expand Down
2 changes: 1 addition & 1 deletion jsExample/src/locales/en-US.js
@@ -1,10 +1,10 @@
import component from './en-US/component';
import globalHeader from './en-US/globalHeader';
import menu from './en-US/menu';
import pages from './en-US/pages';
import pwa from './en-US/pwa';
import settingDrawer from './en-US/settingDrawer';
import settings from './en-US/settings';
import pages from './en-US/pages';

export default {
'navBar.lang': 'Languages',
Expand Down
2 changes: 1 addition & 1 deletion jsExample/src/locales/id-ID.js
@@ -1,10 +1,10 @@
import component from './id-ID/component';
import globalHeader from './id-ID/globalHeader';
import menu from './id-ID/menu';
import pages from './id-ID/pages';
import pwa from './id-ID/pwa';
import settingDrawer from './id-ID/settingDrawer';
import settings from './id-ID/settings';
import pages from './id-ID/pages';

export default {
'navbar.lang': 'Bahasa',
Expand Down
6 changes: 3 additions & 3 deletions jsExample/src/locales/ja-JP.js
@@ -1,10 +1,10 @@
import component from './ja-JP/component';
import globalHeader from './ja-JP/globalHeader';
import menu from './ja-JP/menu';
import pages from './ja-JP/pages';
import pwa from './ja-JP/pwa';
import settingDrawer from './ja-JP/settingDrawer';
import settings from './ja-JP/settings';
import pwa from './ja-JP/pwa';
import component from './ja-JP/component';
import pages from './ja-JP/pages';

export default {
'navBar.lang': '言語',
Expand Down
2 changes: 1 addition & 1 deletion jsExample/src/locales/zh-CN.js
@@ -1,10 +1,10 @@
import component from './zh-CN/component';
import globalHeader from './zh-CN/globalHeader';
import menu from './zh-CN/menu';
import pages from './zh-CN/pages';
import pwa from './zh-CN/pwa';
import settingDrawer from './zh-CN/settingDrawer';
import settings from './zh-CN/settings';
import pages from './zh-CN/pages';

export default {
'navBar.lang': '语言',
Expand Down
4 changes: 2 additions & 2 deletions jsExample/src/models/login.js
@@ -1,9 +1,9 @@
import { stringify } from 'querystring';
import { history } from 'umi';
import { fakeAccountLogin } from '@/services/login';
import { setAuthority } from '@/utils/authority';
import { getPageQuery } from '@/utils/utils';
import { message } from 'antd';
import { stringify } from 'querystring';
import { history } from 'umi';

const Model = {
namespace: 'login',
Expand Down
2 changes: 1 addition & 1 deletion jsExample/src/models/user.js
@@ -1,4 +1,4 @@
import { queryCurrent, query as queryUsers } from '@/services/user';
import { query as queryUsers, queryCurrent } from '@/services/user';

const UserModel = {
namespace: 'user',
Expand Down
4 changes: 2 additions & 2 deletions jsExample/src/pages/Admin.jsx
@@ -1,7 +1,7 @@
import React from 'react';
import { HeartTwoTone, SmileTwoTone } from '@ant-design/icons';
import { Card, Typography, Alert } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Alert, Card, Typography } from 'antd';
import React from 'react';
import { useIntl } from 'umi';

export default () => {
Expand Down
10 changes: 5 additions & 5 deletions jsExample/src/pages/TableList/components/UpdateForm.jsx
@@ -1,14 +1,14 @@
import React from 'react';
import { Modal } from 'antd';
import {
ProFormDateTimePicker,
ProFormRadio,
ProFormSelect,
ProFormText,
ProFormTextArea,
StepsForm,
ProFormRadio,
ProFormDateTimePicker,
} from '@ant-design/pro-form';
import { useIntl, FormattedMessage } from 'umi';
import { Modal } from 'antd';
import React from 'react';
import { FormattedMessage, useIntl } from 'umi';

const UpdateForm = (props) => {
const intl = useIntl();
Expand Down
14 changes: 7 additions & 7 deletions jsExample/src/pages/TableList/index.jsx
@@ -1,13 +1,13 @@
import { PlusOutlined } from '@ant-design/icons';
import { Button, message, Input, Drawer } from 'antd';
import React, { useState, useRef } from 'react';
import { useIntl, FormattedMessage } from 'umi';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
import { ModalForm, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
import ProDescriptions from '@ant-design/pro-descriptions';
import { ModalForm, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
import { FooterToolbar, PageContainer } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
import { Button, Drawer, Input, message } from 'antd';
import React, { useRef, useState } from 'react';
import { FormattedMessage, useIntl } from 'umi';
import UpdateForm from './components/UpdateForm';
import { queryRule, updateRule, addRule, removeRule } from './service';
import { addRule, queryRule, removeRule, updateRule } from './service';
/**
* 添加节点
* @param fields
Expand Down
8 changes: 4 additions & 4 deletions jsExample/src/pages/User/login/index.jsx
@@ -1,3 +1,4 @@
import { getFakeCaptcha } from '@/services/login';
import {
AlipayCircleOutlined,
LockTwoTone,
Expand All @@ -7,11 +8,10 @@ import {
UserOutlined,
WeiboCircleOutlined,
} from '@ant-design/icons';
import { Alert, Space, message, Tabs } from 'antd';
import React, { useState } from 'react';
import ProForm, { ProFormCaptcha, ProFormCheckbox, ProFormText } from '@ant-design/pro-form';
import { useIntl, connect, FormattedMessage } from 'umi';
import { getFakeCaptcha } from '@/services/login';
import { Alert, message, Space, Tabs } from 'antd';
import React, { useState } from 'react';
import { connect, FormattedMessage, useIntl } from 'umi';
import styles from './index.less';

const LoginMessage = ({ content }) => (
Expand Down
6 changes: 3 additions & 3 deletions jsExample/src/pages/Welcome.jsx
@@ -1,7 +1,7 @@
import React from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import { Card, Alert, Typography } from 'antd';
import { useIntl, FormattedMessage } from 'umi';
import { Alert, Card, Typography } from 'antd';
import React from 'react';
import { FormattedMessage, useIntl } from 'umi';
import styles from './Welcome.less';

const CodePreview = ({ children }) => (
Expand Down
2 changes: 1 addition & 1 deletion jsExample/src/utils/request.js
Expand Up @@ -2,8 +2,8 @@
* request 网络请求工具
* 更详细的 api 文档: https://github.com/umijs/umi-request
*/
import { extend } from 'umi-request';
import { notification } from 'antd';
import { extend } from 'umi-request';

const codeMessage = {
200: '服务器成功返回请求的数据。',
Expand Down
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -64,6 +64,8 @@
"fast-glob": "^3.2.4",
"os-locale": "^5.0.0",
"prettier": "^2.3.2",
"prettier-plugin-organize-imports": "^2.3.4",
"prettier-plugin-packagejson": "^2.2.18",
"prettier-plugin-two-style-order": "^1.0.0",
"stylelint": "^13.0.0",
"stylelint-config-css-modules": "^2.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/eslint.ts
@@ -1,5 +1,5 @@
import * as path from 'path';
import * as fs from 'fs';
import * as path from 'path';
import tsEslintConfig from './tsEslintConfig';

const isTypeAwareEnabled = process.env.DISABLE_TYPE_AWARE === undefined;
Expand Down
4 changes: 2 additions & 2 deletions tsExample/config/config.ts
@@ -1,8 +1,8 @@
import slash from 'slash2';
import { IConfig, IPlugin } from 'umi-types';
import defaultSettings from './defaultSettings'; // https://umijs.org/config/

import slash from 'slash2';
import themePluginConfig from './themePluginConfig';

const { pwa } = defaultSettings; // preview.pro.ant.design only do not use in your production ;
// preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。

Expand Down
1 change: 0 additions & 1 deletion tsExample/config/plugin.config.ts
@@ -1,5 +1,4 @@
import path from 'path';

import * as IWebpackChainConfig from 'webpack-chain';

function getModulePackageName(module: { context: string }) {
Expand Down
5 changes: 2 additions & 3 deletions tsExample/src/components/Authorized/Authorized.tsx
@@ -1,9 +1,8 @@
import React from 'react';
import { Result } from 'antd';
import React from 'react';
import type AuthorizedRoute from './AuthorizedRoute';
import type { IAuthorityType } from './CheckPermissions';
import check from './CheckPermissions';

import type AuthorizedRoute from './AuthorizedRoute';
import type Secured from './Secured';

type AuthorizedProps = {
Expand Down
3 changes: 1 addition & 2 deletions tsExample/src/components/Authorized/AuthorizedRoute.tsx
@@ -1,6 +1,5 @@
import { Redirect, Route } from 'umi';

import React from 'react';
import { Redirect, Route } from 'umi';
import Authorized from './Authorized';
import type { IAuthorityType } from './CheckPermissions';

Expand Down
2 changes: 1 addition & 1 deletion tsExample/src/components/Authorized/CheckPermissions.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import { CURRENT } from './renderAuthorize';
// eslint-disable-next-line
import PromiseRender from './PromiseRender';
import { CURRENT } from './renderAuthorize';

export type IAuthorityType =
| undefined
Expand Down
2 changes: 1 addition & 1 deletion tsExample/src/components/Authorized/PromiseRender.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import { Spin } from 'antd';
import isEqual from 'lodash/isEqual';
import React from 'react';
import { isComponentClass } from './Secured';
// eslint-disable-next-line

Expand Down
2 changes: 1 addition & 1 deletion tsExample/src/components/Authorized/index.tsx
@@ -1,7 +1,7 @@
import Authorized from './Authorized';
import Secured from './Secured';
import check from './CheckPermissions';
import renderAuthorize from './renderAuthorize';
import Secured from './Secured';

Authorized.Secured = Secured;
Authorized.check = check;
Expand Down

0 comments on commit d827f8d

Please sign in to comment.