chore: enable no-unused-vars and prefer-template eslint rules (#10350)

This commit is contained in:
Erik Ritter
2020-07-16 19:13:59 -07:00
committed by GitHub
parent 0eee6785a8
commit 09de805017
56 changed files with 66 additions and 119 deletions

View File

@@ -60,7 +60,7 @@ class HighlightedSql extends React.Component {
return lines
.map(line => {
if (line.length > this.props.maxWidth) {
return line.slice(0, this.props.maxWidth) + '{...}';
return `${line.slice(0, this.props.maxWidth)}{...}`;
}
return line;
})

View File

@@ -136,7 +136,7 @@ class QuerySearch extends React.PureComponent {
const validParams = params.filter(function (p) {
return p !== '';
});
return baseUrl + '?' + validParams.join('&');
return `${baseUrl}?${validParams.join('&')}`;
}
changeStatus(status) {
@@ -150,7 +150,7 @@ class QuerySearch extends React.PureComponent {
userLabel(user) {
if (user.first_name && user.last_name) {
return user.first_name + ' ' + user.last_name;
return `${user.first_name} ${user.last_name}`;
}
return user.username;
}

View File

@@ -167,7 +167,7 @@ export default class ResultSet extends React.PureComponent<
{this.props.csv && (
<Button
bsSize="small"
href={'/superset/csv/' + this.props.query.id}
href={`/superset/csv/${this.props.query.id}`}
>
<i className="fa fa-file-text-o" /> {t('.CSV')}
</Button>

View File

@@ -77,10 +77,9 @@ class ShareSqlLabQuery extends React.Component {
let savedQueryToastContent;
if (this.props.queryEditor.remoteId) {
savedQueryToastContent =
window.location.origin +
window.location.pathname +
`?savedQueryId=${this.props.queryEditor.remoteId}`;
savedQueryToastContent = `${
window.location.origin + window.location.pathname
}?savedQueryId=${this.props.queryEditor.remoteId}`;
this.setState({ shortUrl: savedQueryToastContent });
} else {
savedQueryToastContent = t('Please save the query to enable sharing');

View File

@@ -20,7 +20,7 @@ import React from 'react';
import PropTypes from 'prop-types';
export default function TabStatusIcon(props) {
return <div className={'circle ' + props.tabState} />;
return <div className={`circle ${props.tabState}`} />;
}
TabStatusIcon.propTypes = {

View File

@@ -304,7 +304,7 @@ class TabbedSqlEditors extends React.PureComponent {
{isSelected && (
<DropdownButton
bsSize="small"
id={'ddbtn-tab-' + i}
id={`ddbtn-tab-${i}`}
title={' '}
noCaret
>