Browse Source

feat: add extend from prettier/react

pull/18051/head
orzyyyy 5 years ago
parent
commit
44d110c0db
  1. 1
      .eslintrc.js
  2. 2
      components/button/button.tsx
  3. 1
      components/modal/confirm.tsx
  4. 2
      site/theme/template/Home/index.jsx
  5. 2
      site/theme/template/Layout/index.jsx

1
.eslintrc.js

@ -5,6 +5,7 @@ const eslintrc = {
'plugin:jest/recommended',
'plugin:react/recommended',
'plugin:import/typescript',
'prettier/react',
],
env: {
browser: true,

2
components/button/button.tsx

@ -170,7 +170,7 @@ class Button extends React.Component<ButtonProps, ButtonState> {
if (loading && typeof loading !== 'boolean' && loading.delay) {
this.delayTimeout = window.setTimeout(() => this.setState({ loading }), loading.delay);
} else if (prevProps.loading !== this.props.loading) {
// eslint-disable-next-line react/no-did-update-set-state */
// eslint-disable-next-line react/no-did-update-set-state
this.setState({ loading });
}
}

1
components/modal/confirm.tsx

@ -137,6 +137,7 @@ export default function confirm(config: ModalFuncProps) {
}
for (let i = 0; i < destroyFns.length; i++) {
const fn = destroyFns[i];
// eslint-disable-next-line no-use-before-define
if (fn === close) {
destroyFns.splice(i, 1);
break;

2
site/theme/template/Home/index.jsx

@ -58,7 +58,7 @@ function getStyle() {
`;
}
// eslint-disable-next-line react/prefer-stateless-function */
// eslint-disable-next-line react/prefer-stateless-function
class Home extends React.Component {
static contextTypes = {
intl: PropTypes.object.isRequired,

2
site/theme/template/Layout/index.jsx

@ -27,8 +27,8 @@ if (typeof window !== 'undefined') {
// Expose to iframe
window.react = React;
window['react-dom'] = ReactDOM;
// eslint-disable-next-line global-require
window.antd = require('antd');
/* eslint-enable global-require */
// Error log statistic
window.addEventListener('error', function onError(e) {

Loading…
Cancel
Save