From e7c447ab347fd7b45eb5d4f48550f1e5b14fc4e1 Mon Sep 17 00:00:00 2001 From: Rayron Victor Date: Fri, 26 Oct 2018 03:10:19 -0300 Subject: [PATCH] Fix prettier glob (#2673) * SelectLang: languages options don't need to be translated * fix e2e tests when `PORT` is set in `.env` * prettier: fix glob by adding single quotes. * prettier: running prettier after glob fix --- package.json | 2 +- src/components/NoticeIcon/NoticeIconTab.d.ts | 2 +- src/components/PageHeader/index.d.ts | 2 +- src/layouts/Header.js | 6 +++++- src/pages/404.js | 6 +++--- src/pages/List/List.js | 6 +++--- src/pages/List/Projects.js | 10 ++-------- src/pages/User/Login.js | 4 +++- src/utils/request.js | 5 +---- src/utils/utils.test.js | 2 -- 10 files changed, 20 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 2b1cab94..8919c773 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 061cdb6d..729ad592 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 c64e592b..eacbb2de 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 385a8853..01402e30 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 c9040c22..34921c02 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 9483e3d9..d420af59 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 9c62ef16..430ca420 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 3ba2cf5d..5c912372 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 90703f75..398b787f 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 282db154..c97d3254 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(); }); - }); -- GitLab