From 70681d8e606f72bac5f5426497f6f2e7c62282a9 Mon Sep 17 00:00:00 2001 From: xiaohuoni <448627663@qq.com> Date: Wed, 27 Mar 2019 15:53:36 +0800 Subject: [PATCH] code style --- AccountSettings/src/components/base.js | 5 +---- AdvancedForm/src/locales/en-US.js | 3 ++- AdvancedForm/src/locales/pt-BR.js | 3 ++- Analysis/src/components/IntroduceRow.js | 28 ++++++++++++++++++------- Analysis/src/components/OfflineData.js | 5 ++++- Analysis/src/components/TopSearch.js | 18 ++++++++++++---- BasicForm/src/index.js | 5 ++++- BasicForm/src/locales/en-US.js | 3 ++- BasicForm/src/locales/pt-BR.js | 3 ++- Exception403/src/index.tsx | 3 +-- Exception403/tsconfig.json | 8 +------ Exception404/tsconfig.json | 8 +------ Monitor/src/index.js | 14 ++++++++++--- SearchListApplications/src/index.js | 26 ++++++++++++++++------- SearchListArticles/src/index.js | 6 +----- SearchListProjects/src/index.js | 6 +----- StepForm/src/locales/en-US.js | 3 ++- StepForm/src/locales/pt-BR.js | 3 ++- UserLogin/src/index.js | 4 +++- UserLogin/src/locales/en-US.js | 6 ++++-- UserLogin/src/utils/utils.js | 2 +- UserRegister/src/index.js | 5 ++++- UserRegister/src/locales/en-US.js | 6 ++++-- UserRegisterResult/src/locales/en-US.js | 3 ++- _scripts/prettier.js | 9 ++++---- package.json | 2 +- tsconfig.json | 8 +------ 27 files changed, 116 insertions(+), 79 deletions(-) diff --git a/AccountSettings/src/components/base.js b/AccountSettings/src/components/base.js index d9a4bfd8..85764515 100644 --- a/AccountSettings/src/components/base.js +++ b/AccountSettings/src/components/base.js @@ -173,10 +173,7 @@ class BaseView extends Component { })()} diff --git a/AdvancedForm/src/locales/en-US.js b/AdvancedForm/src/locales/en-US.js index 3356dda0..06f130b3 100644 --- a/AdvancedForm/src/locales/en-US.js +++ b/AdvancedForm/src/locales/en-US.js @@ -46,7 +46,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/AdvancedForm/src/locales/pt-BR.js b/AdvancedForm/src/locales/pt-BR.js index 1cc90131..c88bccb3 100644 --- a/AdvancedForm/src/locales/pt-BR.js +++ b/AdvancedForm/src/locales/pt-BR.js @@ -42,7 +42,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/Analysis/src/components/IntroduceRow.js b/Analysis/src/components/IntroduceRow.js index bf7b2f59..1485c417 100755 --- a/Analysis/src/components/IntroduceRow.js +++ b/Analysis/src/components/IntroduceRow.js @@ -22,10 +22,14 @@ const IntroduceRow = memo(({ loading, visitData }) => ( } + title={ + + } action={ } + title={ + + } > @@ -34,7 +38,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( total={() => 126560} footer={ } + label={ + + } value={`¥${numeral(12423).format('0,0')}`} /> } @@ -58,7 +64,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( title={} action={ } + title={ + + } > @@ -66,7 +74,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( total={numeral(8846).format('0,0')} footer={ } + label={ + + } value={numeral(1234).format('0,0')} /> } @@ -82,7 +92,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( title={} action={ } + title={ + + } > @@ -116,7 +128,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( } action={ } + title={ + + } > diff --git a/Analysis/src/components/OfflineData.js b/Analysis/src/components/OfflineData.js index 274c1e0d..44a75d3c 100755 --- a/Analysis/src/components/OfflineData.js +++ b/Analysis/src/components/OfflineData.js @@ -12,7 +12,10 @@ const CustomTab = ({ data, currentTabKey: currentKey }) => ( + } gap={2} total={`${data.cvr * 100}%`} diff --git a/Analysis/src/components/TopSearch.js b/Analysis/src/components/TopSearch.js index 9946b2ad..faf7f557 100755 --- a/Analysis/src/components/TopSearch.js +++ b/Analysis/src/components/TopSearch.js @@ -47,7 +47,10 @@ const TopSearch = memo(({ loading, visitData2, searchData, dropdownGroup }) => ( loading={loading} bordered={false} title={ - + } extra={dropdownGroup} style={{ marginTop: 24 }} @@ -57,9 +60,14 @@ const TopSearch = memo(({ loading, visitData2, searchData, dropdownGroup }) => ( - + } + title={ + + } > @@ -81,7 +89,9 @@ const TopSearch = memo(({ loading, visitData2, searchData, dropdownGroup }) => ( defaultMessage="Per Capita Search" /> } + title={ + + } > diff --git a/BasicForm/src/index.js b/BasicForm/src/index.js index bdef2fee..69235e57 100644 --- a/BasicForm/src/index.js +++ b/BasicForm/src/index.js @@ -115,7 +115,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { /> )} - }> + } + > {getFieldDecorator('standard', { rules: [ { diff --git a/BasicForm/src/locales/en-US.js b/BasicForm/src/locales/en-US.js index 3356dda0..06f130b3 100644 --- a/BasicForm/src/locales/en-US.js +++ b/BasicForm/src/locales/en-US.js @@ -46,7 +46,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/BasicForm/src/locales/pt-BR.js b/BasicForm/src/locales/pt-BR.js index 1cc90131..c88bccb3 100644 --- a/BasicForm/src/locales/pt-BR.js +++ b/BasicForm/src/locales/pt-BR.js @@ -42,7 +42,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/Exception403/src/index.tsx b/Exception403/src/index.tsx index 82babfe4..e632f2a8 100644 --- a/Exception403/src/index.tsx +++ b/Exception403/src/index.tsx @@ -1,4 +1,3 @@ - import React from 'react'; import { formatMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; @@ -7,7 +6,7 @@ import Exception from './components/Exception'; const PAGE_NAME_UPPER_CAMEL_CASE: React.FC = () => ( diff --git a/Exception403/tsconfig.json b/Exception403/tsconfig.json index 48b504b7..b753726e 100644 --- a/Exception403/tsconfig.json +++ b/Exception403/tsconfig.json @@ -22,11 +22,5 @@ } }, "include": ["."], - "exclude": [ - "node_modules", - "_scripts", - "jest", - "tslint:latest", - "tslint-config-prettier" - ] + "exclude": ["node_modules", "_scripts", "jest", "tslint:latest", "tslint-config-prettier"] } diff --git a/Exception404/tsconfig.json b/Exception404/tsconfig.json index 48b504b7..b753726e 100644 --- a/Exception404/tsconfig.json +++ b/Exception404/tsconfig.json @@ -22,11 +22,5 @@ } }, "include": ["."], - "exclude": [ - "node_modules", - "_scripts", - "jest", - "tslint:latest", - "tslint-config-prettier" - ] + "exclude": ["node_modules", "_scripts", "jest", "tslint:latest", "tslint-config-prettier"] } diff --git a/Monitor/src/index.js b/Monitor/src/index.js index f90e0190..cd48ebb7 100644 --- a/Monitor/src/index.js +++ b/Monitor/src/index.js @@ -121,7 +121,9 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { } + title={ + + } style={{ marginBottom: 24 }} bodyStyle={{ textAlign: 'center' }} bordered={false} @@ -152,7 +154,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { animate={false} percent={28} subTitle={ - + } total="28%" height={128} @@ -220,7 +225,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { + } percent={34} /> diff --git a/SearchListApplications/src/index.js b/SearchListApplications/src/index.js index e9e458b2..5de54a08 100644 --- a/SearchListApplications/src/index.js +++ b/SearchListApplications/src/index.js @@ -1,7 +1,20 @@ import React, { PureComponent } from 'react'; import numeral from 'numeral'; import { connect } from 'dva'; -import { Row, Col, Form, Card, Select, Icon, Avatar, List, Tooltip, Dropdown, Menu, Input } from 'antd'; +import { + Row, + Col, + Form, + Card, + Select, + Icon, + Avatar, + List, + Tooltip, + Dropdown, + Menu, + Input, +} from 'antd'; import { TagSelect } from 'ant-design-pro'; import StandardFormRow from './components/StandardFormRow'; @@ -102,11 +115,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { ); return ( - +
@@ -181,7 +190,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { , ]} > - } title={item.title} /> + } + title={item.title} + />
+ diff --git a/SearchListProjects/src/index.js b/SearchListProjects/src/index.js index 89d510bd..4db3ba69 100644 --- a/SearchListProjects/src/index.js +++ b/SearchListProjects/src/index.js @@ -107,11 +107,7 @@ class CoverCardList extends PureComponent { ); return ( - +
diff --git a/StepForm/src/locales/en-US.js b/StepForm/src/locales/en-US.js index 3356dda0..06f130b3 100644 --- a/StepForm/src/locales/en-US.js +++ b/StepForm/src/locales/en-US.js @@ -46,7 +46,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/StepForm/src/locales/pt-BR.js b/StepForm/src/locales/pt-BR.js index 1cc90131..c88bccb3 100644 --- a/StepForm/src/locales/pt-BR.js +++ b/StepForm/src/locales/pt-BR.js @@ -42,7 +42,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/UserLogin/src/index.js b/UserLogin/src/index.js index 33ba5e1b..0c4480bb 100644 --- a/UserLogin/src/index.js +++ b/UserLogin/src/index.js @@ -81,7 +81,9 @@ class LoginPage extends Component { {status === 'error' && loginType === 'account' && !submitting && - this.renderMessage(formatMessage({ id: 'BLOCK_NAME.login.message-invalid-credentials' }))} + this.renderMessage( + formatMessage({ id: 'BLOCK_NAME.login.message-invalid-credentials' }) + )} + )} diff --git a/UserRegister/src/locales/en-US.js b/UserRegister/src/locales/en-US.js index f58ec412..2ce4a265 100644 --- a/UserRegister/src/locales/en-US.js +++ b/UserRegister/src/locales/en-US.js @@ -1,7 +1,8 @@ export default { 'BLOCK_NAME.login.userName': 'userName', 'BLOCK_NAME.login.password': 'password', - 'BLOCK_NAME.login.message-invalid-credentials': 'Invalid username or password(admin/ant.design)', + 'BLOCK_NAME.login.message-invalid-credentials': + 'Invalid username or password(admin/ant.design)', 'BLOCK_NAME.login.message-invalid-verification-code': 'Invalid verification code', 'BLOCK_NAME.login.tab-login-credentials': 'Credentials', 'BLOCK_NAME.login.tab-login-mobile': 'Mobile number', @@ -60,7 +61,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/UserRegisterResult/src/locales/en-US.js b/UserRegisterResult/src/locales/en-US.js index 471776ca..1d04b0a5 100644 --- a/UserRegisterResult/src/locales/en-US.js +++ b/UserRegisterResult/src/locales/en-US.js @@ -1,7 +1,8 @@ export default { 'BLOCK_NAME.login.userName': 'userName', 'BLOCK_NAME.login.password': 'password', - 'BLOCK_NAME.login.message-invalid-credentials': 'Invalid username or password(admin/ant.design)', + 'BLOCK_NAME.login.message-invalid-credentials': + 'Invalid username or password(admin/ant.design)', 'BLOCK_NAME.login.message-invalid-verification-code': 'Invalid verification code', 'BLOCK_NAME.login.tab-login-credentials': 'Credentials', 'BLOCK_NAME.login.tab-login-mobile': 'Mobile number', diff --git a/_scripts/prettier.js b/_scripts/prettier.js index d42fa0ed..6c7d8539 100644 --- a/_scripts/prettier.js +++ b/_scripts/prettier.js @@ -15,14 +15,15 @@ const prettierConfigPath = require.resolve('../.prettierrc'); let didError = false; let files = []; -const jsFiles = glob.sync('ant-design-pro/**/*.js*', { - ignore: ['**/node_modules/**', 'build/**'], +const jsFiles = glob.sync('**/src/*.js*', { + ignore: ['**/node_modules/**', 'build/**', '**/.umi/**'], }); -const tsFiles = glob.sync('ant-design-pro/**/*.ts*', { - ignore: ['**/node_modules/**', 'build/**'], +const tsFiles = glob.sync('**/src/*.ts*', { + ignore: ['**/node_modules/**', 'build/**', '**/.umi/**'], }); files = files.concat(jsFiles); files = files.concat(tsFiles); + if (!files.length) { return; } diff --git a/package.json b/package.json index 6f51cd4f..7ead9b8e 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "lint:fix": "eslint --fix --ext .js src mock tests && npm run lint:style", "lint-staged": "lint-staged", "lint-staged:js": "eslint --ext .js", - "prettier": "node ./_scripts/prettier.jsy" + "prettier": "node ./_scripts/prettier.js" }, "devDependencies": { "@types/classnames": "^2.2.7", diff --git a/tsconfig.json b/tsconfig.json index 48b504b7..b753726e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,11 +22,5 @@ } }, "include": ["."], - "exclude": [ - "node_modules", - "_scripts", - "jest", - "tslint:latest", - "tslint-config-prettier" - ] + "exclude": ["node_modules", "_scripts", "jest", "tslint:latest", "tslint-config-prettier"] } -- GitLab