diff --git a/.eslintrc b/.eslintrc deleted file mode 100755 index c5dda4d706868f0c65f9fc7b5aa76f1acc18a9c3..0000000000000000000000000000000000000000 --- a/.eslintrc +++ /dev/null @@ -1,71 +0,0 @@ -{ - "parser": "babel-eslint", - "extends": ["airbnb", "prettier"], - "env": { - "browser": true, - "node": true, - "es6": true, - "mocha": true, - "jest": true, - "jasmine": true - }, - "rules": { - "generator-star-spacing": [0], - "consistent-return": [0], - "react/forbid-prop-types": [0], - "react/jsx-filename-extension": [1, { "extensions": [".js"] }], - "global-require": [1], - "import/prefer-default-export": [0], - "react/jsx-no-bind": [0], - "react/prop-types": [0], - "react/prefer-stateless-function": [0], - "react/jsx-wrap-multilines": [ - "error", - { - "declaration": "parens-new-line", - "assignment": "parens-new-line", - "return": "parens-new-line", - "arrow": "parens-new-line", - "condition": "parens-new-line", - "logical": "parens-new-line", - "prop": "ignore" - } - ], - "no-else-return": [0], - "no-restricted-syntax": [0], - "import/no-extraneous-dependencies": [0], - "no-use-before-define": [0], - "jsx-a11y/no-static-element-interactions": [0], - "jsx-a11y/no-noninteractive-element-interactions": [0], - "jsx-a11y/click-events-have-key-events": [0], - "jsx-a11y/anchor-is-valid": [0], - "no-nested-ternary": [0], - "arrow-body-style": [0], - "import/extensions": [0], - "no-bitwise": [0], - "no-cond-assign": [0], - "import/no-unresolved": [0], - "comma-dangle": [ - "error", - { - "arrays": "always-multiline", - "objects": "always-multiline", - "imports": "always-multiline", - "exports": "always-multiline", - "functions": "ignore" - } - ], - "object-curly-newline": [0], - "function-paren-newline": [0], - "no-restricted-globals": [0], - "require-yield": [1] - }, - "parserOptions": { - "ecmaFeatures": { - "experimentalObjectRestSpread": true - } - }, - "settings": { - "polyfills": ["fetch", "promises"] - } -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100755 index 0000000000000000000000000000000000000000..e29c1a8a6221f03d61414a04824b100e0e46a6b7 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,71 @@ +module.exports = { + parser: 'babel-eslint', + extends: ['airbnb', 'prettier'], + env: { + browser: true, + node: true, + es6: true, + mocha: true, + jest: true, + jasmine: true, + }, + rules: { + 'generator-star-spacing': [0], + 'consistent-return': [0], + 'react/forbid-prop-types': [0], + 'react/jsx-filename-extension': [1, { extensions: ['.js'] }], + 'global-require': [1], + 'import/prefer-default-export': [0], + 'react/jsx-no-bind': [0], + 'react/prop-types': [0], + 'react/prefer-stateless-function': [0], + 'react/jsx-wrap-multilines': [ + 'error', + { + declaration: 'parens-new-line', + assignment: 'parens-new-line', + return: 'parens-new-line', + arrow: 'parens-new-line', + condition: 'parens-new-line', + logical: 'parens-new-line', + prop: 'ignore', + }, + ], + 'no-else-return': [0], + 'no-restricted-syntax': [0], + 'import/no-extraneous-dependencies': [0], + 'no-use-before-define': [0], + 'jsx-a11y/no-static-element-interactions': [0], + 'jsx-a11y/no-noninteractive-element-interactions': [0], + 'jsx-a11y/click-events-have-key-events': [0], + 'jsx-a11y/anchor-is-valid': [0], + 'no-nested-ternary': [0], + 'arrow-body-style': [0], + 'import/extensions': [0], + 'no-bitwise': [0], + 'no-cond-assign': [0], + 'import/no-unresolved': [0], + 'comma-dangle': [ + 'error', + { + arrays: 'always-multiline', + objects: 'always-multiline', + imports: 'always-multiline', + exports: 'always-multiline', + functions: 'ignore', + }, + ], + 'object-curly-newline': [0], + 'function-paren-newline': [0], + 'no-restricted-globals': [0], + 'require-yield': [1], + }, + parserOptions: { + ecmaFeatures: { + experimentalObjectRestSpread: true, + }, + }, + settings: { + polyfills: ['fetch', 'promises'], + }, +}; diff --git a/package.json b/package.json index 9b6cf671f5d0f7b96e8eeb7d41b0f52d701bf31e..51a9eda91e99287705bef90c6865e09e1270bc69 100755 --- a/package.json +++ b/package.json @@ -25,12 +25,13 @@ "@babel/polyfill": "^7.0.0-beta.36", "@types/react": "^16.3.8", "@types/react-dom": "^16.0.5", - "antd": "^3.4.1", + "bizcharts-plugin-slider": "^2.0.3", + "antd": "^3.4.3", + "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-runtime": "^6.9.2", "bizcharts": "^3.1.5", - "bizcharts-plugin-slider": "^2.0.3", "classnames": "^2.2.5", - "dva": "^2.2.2", + "dva": "^2.2.3", "dva-loading": "^1.0.4", "enquire-js": "^0.2.1", "lodash": "^4.17.4", @@ -76,7 +77,7 @@ "redbox-react": "^1.5.0", "regenerator-runtime": "^0.11.1", "roadhog": "^2.3.0", - "roadhog-api-doc": "^0.3.4", + "roadhog-api-doc": "^1.0.2", "stylelint": "^8.4.0", "stylelint-config-prettier": "^3.0.4", "stylelint-config-standard": "^18.0.0" diff --git a/src/components/Charts/ChartCard/index.d.ts b/src/components/Charts/ChartCard/index.d.ts index 80fd37623f7944f2de168f20efbb44eaf10a75b2..d174593fddc4d0e6aa59b4726a973e1f7ca90673 100644 --- a/src/components/Charts/ChartCard/index.d.ts +++ b/src/components/Charts/ChartCard/index.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; export interface IChartCardProps { title: React.ReactNode; action?: React.ReactNode; - total?: React.ReactNode | function | number; + total?: React.ReactNode | number | (() => React.ReactNode | number); footer?: React.ReactNode; contentHeight?: number; avatar?: React.ReactNode; diff --git a/src/components/Charts/Pie/index.d.ts b/src/components/Charts/Pie/index.d.ts index 5b19208d6979a57301ebff41a837e033f5cfe357..46e4600d80c8eb71cfec87bbc8f12406cb685173 100644 --- a/src/components/Charts/Pie/index.d.ts +++ b/src/components/Charts/Pie/index.d.ts @@ -10,7 +10,7 @@ export interface IPieProps { x: string | string; y: number; }>; - total?: string | function; + total?: React.ReactNode | number | (() => React.ReactNode | number); title?: React.ReactNode; tooltip?: boolean; valueFormat?: (value: string) => string | React.ReactNode; diff --git a/src/components/DescriptionList/DescriptionList.js b/src/components/DescriptionList/DescriptionList.js index 128b0d31b423be0d05b4303ab9b13d85957bbba2..73ba989c0e06b4e4ef91c906a79b7f1f48e9ef10 100644 --- a/src/components/DescriptionList/DescriptionList.js +++ b/src/components/DescriptionList/DescriptionList.js @@ -3,7 +3,7 @@ import classNames from 'classnames'; import { Row } from 'antd'; import styles from './index.less'; -export default ({ +const DescriptionList = ({ className, title, col = 3, @@ -27,3 +27,5 @@ export default ({ ); }; + +export default DescriptionList; diff --git a/src/components/DescriptionList/index.less b/src/components/DescriptionList/index.less index ebffa55f3da0f353e3345370f0b91fb4ed168f71..bcb6fd1da7a1f9fe875c617fad8e54ebd9fb495c 100644 --- a/src/components/DescriptionList/index.less +++ b/src/components/DescriptionList/index.less @@ -17,7 +17,8 @@ } .term { - line-height: 22px; + // Line-height is 22px IE dom height will calculate error + line-height: 20px; padding-bottom: 16px; margin-right: 8px; color: @heading-color; diff --git a/src/components/Exception/index.js b/src/components/Exception/index.js index 4fc813fbd96e04d8ebd2baf19f194f04888d4290..14703e34275e6f32bd87b8c958f2150d48ea848c 100644 --- a/src/components/Exception/index.js +++ b/src/components/Exception/index.js @@ -4,7 +4,7 @@ import { Button } from 'antd'; import config from './typeConfig'; import styles from './index.less'; -export default ({ className, linkElement = 'a', type, title, desc, img, actions, ...rest }) => { +const Exception = ({ className, linkElement = 'a', type, title, desc, img, actions, ...rest }) => { const pageType = type in config ? type : '404'; const clsString = classNames(styles.exception, className); return ( @@ -33,3 +33,5 @@ export default ({ className, linkElement = 'a', type, title, desc, img, actions, ); }; + +export default Exception; diff --git a/src/components/GlobalFooter/index.d.ts b/src/components/GlobalFooter/index.d.ts index 85a9ca65495bff59c038c558a69b64afff3013f2..3fa5c423eba263aa4c9d39eb49f395781c5e8f43 100644 --- a/src/components/GlobalFooter/index.d.ts +++ b/src/components/GlobalFooter/index.d.ts @@ -1,6 +1,7 @@ import * as React from 'react'; export interface IGlobalFooterProps { links?: Array<{ + key?: string; title: React.ReactNode; href: string; blankTarget?: boolean; diff --git a/src/components/GlobalFooter/index.js b/src/components/GlobalFooter/index.js index 837fe6f9179a7c89858f771e3f0b67bc5b417874..f557213191cdd2fe7fa6dc6d9dbca8a7311ae837 100644 --- a/src/components/GlobalFooter/index.js +++ b/src/components/GlobalFooter/index.js @@ -2,7 +2,7 @@ import React from 'react'; import classNames from 'classnames'; import styles from './index.less'; -export default ({ className, links, copyright }) => { +const GlobalFooter = ({ className, links, copyright }) => { const clsString = classNames(styles.globalFooter, className); return (