Commit e7c447ab authored by Rayron Victor's avatar Rayron Victor Committed by 陈帅

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
parent 1d39d7ef
......@@ -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",
......
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;
......
......@@ -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<IPageHeaderProps, any> {}
......@@ -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',
......
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 () => (
<Exception
type="404"
linkElement={Link}
desc={formatMessage({id: 'app.exception.description.404'})}
backText={formatMessage({id: 'app.exception.back'})}
desc={formatMessage({ id: 'app.exception.description.404' })}
backText={formatMessage({ id: 'app.exception.back' })}
/>
);
......@@ -21,12 +21,12 @@ class SearchList extends Component {
default:
break;
}
}
};
handleFormSubmit = (value) => {
handleFormSubmit = value => {
// eslint-disable-next-line
console.log(value);
}
};
render() {
const tabList = [
......
......@@ -125,10 +125,7 @@ class CoverCardList extends PureComponent {
<Col lg={8} md={10} sm={10} xs={24}>
<FormItem {...formItemLayout} label="作者">
{getFieldDecorator('author', {})(
<Select
placeholder="不限"
style={{ maxWidth: 200, width: '100%' }}
>
<Select placeholder="不限" style={{ maxWidth: 200, width: '100%' }}>
<Option value="lisa">王昭君</Option>
</Select>
)}
......@@ -137,10 +134,7 @@ class CoverCardList extends PureComponent {
<Col lg={8} md={10} sm={10} xs={24}>
<FormItem {...formItemLayout} label="好评度">
{getFieldDecorator('rate', {})(
<Select
placeholder="不限"
style={{ maxWidth: 200, width: '100%' }}
>
<Select placeholder="不限" style={{ maxWidth: 200, width: '100%' }}>
<Option value="good">优秀</Option>
<Option value="normal">普通</Option>
</Select>
......
......@@ -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' })
)}
<Mobile name="mobile" />
<Captcha name="captcha" countDown={120} onGetCaptcha={this.onGetCaptcha} />
</Tab>
......
......@@ -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,
......
......@@ -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();
});
});
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