diff --git a/package.json b/package.json index 2b1cab9486e5adee2f62b571e89300c959c23d7d..8919c773f1965458ee68ad02b07596f4d593d051 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "test": "umi test", "test:component": "umi test ./src/components", "test:all": "node ./tests/run-tests.js", - "prettier": "prettier --write ./src/**/**/**/*", + "prettier": "prettier --write './src/**/*'", "docker:dev": "docker-compose -f ./docker/docker-compose.dev.yml up", "docker:build": "docker-compose -f ./docker/docker-compose.dev.yml build", "docker-prod:dev": "docker-compose -f ./docker/docker-compose.yml up", diff --git a/src/components/NoticeIcon/NoticeIconTab.d.ts b/src/components/NoticeIcon/NoticeIconTab.d.ts index 061cdb6d7b689bcb6e53210294b89248cd48bbe9..729ad592686fb5920a87332ec40f25a8d29c59f1 100644 --- a/src/components/NoticeIcon/NoticeIconTab.d.ts +++ b/src/components/NoticeIcon/NoticeIconTab.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; export interface INoticeIconData { - avatar?: string|React.ReactNode; + avatar?: string | React.ReactNode; title?: React.ReactNode; description?: React.ReactNode; datetime?: React.ReactNode; diff --git a/src/components/PageHeader/index.d.ts b/src/components/PageHeader/index.d.ts index c64e592b480332a97ab5691a92f4e657d3985d81..eacbb2de903681f1eee250d83c71e4642ca41d0d 100644 --- a/src/components/PageHeader/index.d.ts +++ b/src/components/PageHeader/index.d.ts @@ -17,7 +17,7 @@ export interface IPageHeaderProps { style?: React.CSSProperties; home?: React.ReactNode; wide?: boolean; - hiddenBreadcrumb?:boolean; + hiddenBreadcrumb?: boolean; } export default class PageHeader extends React.Component {} diff --git a/src/layouts/Header.js b/src/layouts/Header.js index 385a8853168be85844222cbdb73de02078b5ddca..01402e30d5e77596bb16546ec2ec172182a71cc7 100644 --- a/src/layouts/Header.js +++ b/src/layouts/Header.js @@ -43,7 +43,11 @@ class HeaderView extends PureComponent { }; handleNoticeClear = type => { - message.success(`${formatMessage({ id: 'component.noticeIcon.cleared' })} ${formatMessage({ id: `component.globalHeader.${type}` })}`); + message.success( + `${formatMessage({ id: 'component.noticeIcon.cleared' })} ${formatMessage({ + id: `component.globalHeader.${type}`, + })}` + ); const { dispatch } = this.props; dispatch({ type: 'global/clearNotices', diff --git a/src/pages/404.js b/src/pages/404.js index c9040c2278e7b36efbeeebdf7011e72646fe132c..34921c02b789dff7b692f12d6b1ceb9a562ce372 100644 --- a/src/pages/404.js +++ b/src/pages/404.js @@ -1,13 +1,13 @@ import React from 'react'; import Link from 'umi/link'; -import { formatMessage } from "umi/locale"; +import { formatMessage } from 'umi/locale'; import Exception from '@/components/Exception'; export default () => ( ); diff --git a/src/pages/List/List.js b/src/pages/List/List.js index 9483e3d962758693c46fe94f8f93c6e2a63b1823..d420af59222ab79c24ae894225b6d08437cf095a 100644 --- a/src/pages/List/List.js +++ b/src/pages/List/List.js @@ -21,12 +21,12 @@ class SearchList extends Component { default: break; } - } + }; - handleFormSubmit = (value) => { + handleFormSubmit = value => { // eslint-disable-next-line console.log(value); - } + }; render() { const tabList = [ diff --git a/src/pages/List/Projects.js b/src/pages/List/Projects.js index 9c62ef160c836be112ebcf661f765337adfebe62..430ca4201803d71f85fb84a98b2ca3fa4bdac9c2 100644 --- a/src/pages/List/Projects.js +++ b/src/pages/List/Projects.js @@ -125,10 +125,7 @@ class CoverCardList extends PureComponent { {getFieldDecorator('author', {})( - )} @@ -137,10 +134,7 @@ class CoverCardList extends PureComponent { {getFieldDecorator('rate', {})( - diff --git a/src/pages/User/Login.js b/src/pages/User/Login.js index 3ba2cf5d119fcd059fe652c8013137f4beb81bae..5c9123729b86e9ad4d98d141d79d1ee220846bdc 100644 --- a/src/pages/User/Login.js +++ b/src/pages/User/Login.js @@ -92,7 +92,9 @@ class LoginPage extends Component { {login.status === 'error' && login.type === 'mobile' && !submitting && - this.renderMessage(formatMessage({ id: 'app.login.message-invalid-verification-code' }))} + this.renderMessage( + formatMessage({ id: 'app.login.message-invalid-verification-code' }) + )} diff --git a/src/utils/request.js b/src/utils/request.js index 90703f75389836ab9648166b4123faf8c0617f86..398b787f1e5d8cd3381c8fbd9201dd33544ac9d5 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -63,10 +63,7 @@ const cachedSave = (response, hashcode) => { * @param {object} [option] The options we want to pass to "fetch" * @return {object} An object containing either "data" or "err" */ -export default function request( - url, - option, -) { +export default function request(url, option) { const options = { expirys: isAntdPro(), ...option, diff --git a/src/utils/utils.test.js b/src/utils/utils.test.js index 282db154183380d3ba7e1e218c2dce3257dda561..c97d3254659abf88b598977027b26af9f94a0ebe 100644 --- a/src/utils/utils.test.js +++ b/src/utils/utils.test.js @@ -22,7 +22,6 @@ describe('fixedZero tests', () => { expect(fixedZero(8)).toEqual('08'); expect(fixedZero(9)).toEqual('09'); }); - }); describe('isUrl tests', () => { @@ -60,5 +59,4 @@ describe('isUrl tests', () => { expect(isUrl('http://www.example.com/test/123?foo=bar')).toBeTruthy(); expect(isUrl('https://www.example.com/test/123?foo=bar')).toBeTruthy(); }); - });