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

@@ -31,7 +31,7 @@ describe('AnchorLink', () => {
global.window = Object.create(window);
Object.defineProperty(window, 'location', {
value: {
hash: '#' + props.anchorLinkId,
hash: `#${props.anchorLinkId}`,
},
});
});

View File

@@ -19,7 +19,7 @@
import React from 'react';
import { shallow } from 'enzyme';
import { ColumnOption, ColumnTypeLabel } from '@superset-ui/chart-controls';
import { ColumnTypeLabel } from '@superset-ui/chart-controls';
describe('ColumnOption', () => {
const defaultProps = {

View File

@@ -20,7 +20,6 @@ import React from 'react';
import { mount, shallow } from 'enzyme';
import { act } from 'react-dom/test-utils';
import { MenuItem } from 'react-bootstrap';
import Select from 'src/components/Select';
import { QueryParamProvider } from 'use-query-params';
import { supersetTheme, ThemeProvider } from '@superset-ui/style';
@@ -29,7 +28,6 @@ import ListViewFilters from 'src/components/ListView/Filters';
import ListViewPagination from 'src/components/ListView/Pagination';
import Pagination from 'src/components/Pagination';
import Button from 'src/components/Button';
import { areArraysShallowEqual } from 'src/reduxUtils';
import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
import IndeterminateCheckbox from 'src/components/IndeterminateCheckbox';

View File

@@ -20,12 +20,7 @@
import React from 'react';
import sinon from 'sinon';
import { shallow } from 'enzyme';
import {
Select,
AsyncSelect,
OnPasteSelect,
CreatableSelect,
} from 'src/components/Select';
import { Select, OnPasteSelect, CreatableSelect } from 'src/components/Select';
const defaultProps = {
onChange: sinon.spy(),

View File

@@ -21,7 +21,7 @@ import { mount, shallow } from 'enzyme';
import ModalTrigger from 'src/components/ModalTrigger';
import RefreshIntervalModal from 'src/dashboard/components/RefreshIntervalModal';
import { Modal, Alert } from 'react-bootstrap';
import { Alert } from 'react-bootstrap';
describe('RefreshIntervalModal', () => {
const mockedProps = {

View File

@@ -66,7 +66,6 @@ describe('ExploreChartHeader', () => {
});
it('should update title but not save', () => {
const newTitle = 'New Chart Title';
const editableTitle = wrapper.find(EditableTitle);
expect(editableTitle.props().onSaveTitle).toBe(updateChartTitleStub);
});

View File

@@ -85,7 +85,7 @@ describe('MetricsControl', () => {
{ optionName: '_col_value', type: 'DOUBLE', column_name: 'value' },
...Object.keys(AGGREGATES).map(aggregate => ({
aggregate_name: aggregate,
optionName: '_aggregate_' + aggregate,
optionName: `_aggregate_${aggregate}`,
})),
{
optionName: 'sum__value',

View File

@@ -19,7 +19,6 @@
import { Alert } from 'react-bootstrap';
import React from 'react';
import { mount } from 'enzyme';
import { act } from 'react-dom/test-utils';
import Toast from 'src/messageToasts/components/Toast';
import mockMessageToasts from '../mockMessageToasts';

View File

@@ -18,7 +18,6 @@
*/
import React from 'react';
import { shallow } from 'enzyme';
import { Checkbox } from 'react-bootstrap';
import {
SQL_EDITOR_GUTTER_HEIGHT,
SQL_EDITOR_GUTTER_MARGIN,

View File

@@ -58,7 +58,7 @@ describe('async actions', () => {
);
const runQueryEndpoint = 'glob:*/superset/sql_json/*';
fetchMock.post(runQueryEndpoint, '{ "data": ' + mockBigNumber + ' }');
fetchMock.post(runQueryEndpoint, `{ "data": ${mockBigNumber} }`);
describe('saveQuery', () => {
const saveQueryEndpoint = 'glob:*/savedqueryviewapi/api/create';