1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +00:00

[eslint] updated eslintrc and improved the code (#4702)

This commit is contained in:
llj
2020-11-02 13:56:35 +08:00
committed by GitHub
parent ed3e5fc416
commit 04f29704b3
337 changed files with 1586 additions and 1585 deletions

View File

@@ -50,6 +50,7 @@
"no-irregular-whitespace": "warn", "no-irregular-whitespace": "warn",
"no-console": "warn", "no-console": "warn",
"no-useless-escape": "warn", "no-useless-escape": "warn",
"no-trailing-spaces": "warn",
"react/jsx-indent": ["warn", 2], "react/jsx-indent": ["warn", 2],
"react/prop-types": "warn", "react/prop-types": "warn",

View File

@@ -25,7 +25,7 @@ class AddMemberDialog extends React.Component {
handleSubmit = () => { handleSubmit = () => {
if (!this.state.selectedOption) return; if (!this.state.selectedOption) return;
const emails = this.state.selectedOption.map(item => item.email); const emails = this.state.selectedOption.map(item => item.email);
this.props.addUser(emails) this.props.addUser(emails);
} }
render() { render() {

View File

@@ -44,7 +44,7 @@ class UploadProgressDialog extends React.Component {
render() { render() {
let uploadBitrate = Utils.formatBitRate(this.props.uploadBitrate) let uploadBitrate = Utils.formatBitRate(this.props.uploadBitrate);
let uploadedMessage = gettext('File Upload'); let uploadedMessage = gettext('File Upload');
let uploadingMessage = gettext('File Uploading...') + ' ' + this.props.totalProgress + '%' + ' (' + uploadBitrate + ')'; let uploadingMessage = gettext('File Uploading...') + ' ' + this.props.totalProgress + '%' + ' (' + uploadBitrate + ')';

View File

@@ -4,7 +4,7 @@ import { gettext, loginUrl } from '../utils/constants';
function PermissionDeniedTip() { function PermissionDeniedTip() {
let reloginUrl = `${loginUrl}?next=${encodeURIComponent(location.href)}`; let reloginUrl = `${loginUrl}?next=${encodeURIComponent(location.href)}`;
let errorTip = gettext('Permission denied. Please try {placeholder-left}login again.{placeholder-right}'); let errorTip = gettext('Permission denied. Please try {placeholder-left}login again.{placeholder-right}');
errorTip = errorTip.replace('{placeholder-left}', '<a class="action-link p-0" href='+ reloginUrl + '>') errorTip = errorTip.replace('{placeholder-left}', '<a class="action-link p-0" href='+ reloginUrl + '>');
errorTip = errorTip.replace('{placeholder-right}', '</a>'); errorTip = errorTip.replace('{placeholder-right}', '</a>');
return( return(
<span className="error" dangerouslySetInnerHTML={{__html: errorTip}}></span> <span className="error" dangerouslySetInnerHTML={{__html: errorTip}}></span>

View File

@@ -15,7 +15,7 @@ class TermsPreviewWidget extends React.Component {
this.state = { this.state = {
innerHtml: null, innerHtml: null,
isFormatValue: true, isFormatValue: true,
} };
} }
componentDidMount() { componentDidMount() {

View File

@@ -313,7 +313,7 @@ class Draft extends React.Component {
const nodes = this.refs.diffViewer.value; const nodes = this.refs.diffViewer.value;
let commentNode = nodes.find((node) => { let commentNode = nodes.find((node) => {
if (node.data['old_index'] == oldIndex && node.data['new_index'] == newIndex) { if (node.data['old_index'] == oldIndex && node.data['new_index'] == newIndex) {
return node return node;
} }
}); });
if (commentNode) { if (commentNode) {

View File

@@ -56,7 +56,7 @@ class LibContentToolbar extends React.Component {
render() { render() {
if (!this.props.userPerm) { if (!this.props.userPerm) {
return <div className="cur-view-toolbar"></div> return <div className="cur-view-toolbar"></div>;
} }
if (this.props.isViewFile) { if (this.props.isViewFile) {

View File

@@ -653,7 +653,7 @@ class LibContentView extends React.Component {
this.setState({ this.setState({
asyncOperationProgress: 0, asyncOperationProgress: 0,
isCopyMoveProgressDialogShow: false, isCopyMoveProgressDialogShow: false,
}) });
} }
// toolbar operations // toolbar operations

File diff suppressed because one or more lines are too long