Commit 3a08a00f authored by afc163's avatar afc163

Add eslint-plugin-compat

parent 3def673b
const path = require('path');
module.exports = {
plugins: [
[
'module-resolver',
{
alias: {
components: path.join(__dirname, './src/components'),
},
},
],
[
'import',
{
libraryName: 'antd',
style: true, // or 'css'
},
],
],
};
module.exports = {
parser: 'babel-eslint',
extends: ['airbnb', 'prettier'],
extends: ['airbnb', 'prettier', 'plugin:compat/recommended'],
env: {
browser: true,
node: true,
......@@ -13,7 +13,6 @@ module.exports = {
'react/jsx-filename-extension': [1, { extensions: ['.js'] }],
'react/jsx-wrap-multilines': 0,
'react/prop-types': 0,
'react/prefer-stateless-function': 0,
'react/forbid-prop-types': 0,
'react/jsx-one-expression-per-line': 0,
'import/no-unresolved': 0,
......@@ -24,6 +23,6 @@ module.exports = {
'jsx-a11y/anchor-is-valid': 0,
},
settings: {
polyfills: ['fetch', 'promises'],
polyfills: ['fetch', 'promises', 'url'],
},
};
import React from 'react';
import CheckPermissions from './CheckPermissions';
class Authorized extends React.Component {
render() {
const { children, authority, noMatch = null } = this.props;
const Authorized = ({ children, authority, noMatch = null }) => {
const childrenRender = typeof children === 'undefined' ? null : children;
return CheckPermissions(authority, childrenRender, noMatch);
}
}
};
export default Authorized;
import React, { Component } from 'react';
import React from 'react';
import { formatMessage } from 'umi/locale';
import Link from 'umi/link';
import Exception from '@/components/Exception';
class Exception403 extends Component {
render() {
return (
const Exception403 = () => (
<Exception
type="403"
desc={formatMessage({ id: 'app.exception.description.403' }, {})}
......@@ -13,7 +11,6 @@ class Exception403 extends Component {
linkElement={Link}
backText={formatMessage({ id: 'app.exception.back' })}
/>
);
}
}
);
export default Exception403;
import React, { Component } from 'react';
import React from 'react';
import { formatMessage } from 'umi/locale';
import Link from 'umi/link';
import Exception from '@/components/Exception';
class Exception404 extends Component {
render() {
return (
const Exception404 = () => (
<Exception
type="404"
desc={formatMessage({ id: 'app.exception.description.404' }, {})}
......@@ -13,7 +11,6 @@ class Exception404 extends Component {
linkElement={Link}
backText={formatMessage({ id: 'app.exception.back' })}
/>
);
}
}
);
export default Exception404;
import React, { Component } from 'react';
import React from 'react';
import { formatMessage } from 'umi/locale';
import Link from 'umi/link';
import Exception from '@/components/Exception';
class Exception500 extends Component {
render() {
return (
const Exception500 = () => (
<Exception
type="500"
desc={formatMessage({ id: 'app.exception.description.500' }, {})}
......@@ -13,7 +11,6 @@ class Exception500 extends Component {
linkElement={Link}
backText={formatMessage({ id: 'app.exception.back' })}
/>
);
}
}
);
export default Exception500;
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