remove unneeded eslint-disable directives (#37922)

* remove unneeded eslint-disable directives
This commit is contained in:
Matthew Kime 2019-06-04 07:53:22 -05:00 committed by GitHub
parent 5ac71cf428
commit 964f9e2d41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 61 additions and 61 deletions

View file

@ -293,7 +293,7 @@ export const ExplorerSwimlane = injectI18n(class ExplorerSwimlane extends React.
};
}
function cellMouseover(target, laneLabel, bucketScore, index, time) { // eslint-disable-line no-unused-vars
function cellMouseover(target, laneLabel, bucketScore, index, time) {
if (bucketScore === undefined || cellMouseoverActive === false) {
return;
}
@ -368,7 +368,7 @@ export const ExplorerSwimlane = injectI18n(class ExplorerSwimlane extends React.
// TODO - mark if zoomed in to bucket width?
let time = startTime;
Array(numBuckets || 0).fill(null).forEach((v, i) => { // eslint-disable-line no-unused-vars
Array(numBuckets || 0).fill(null).forEach((v, i) => {
const cell = cellsContainer.append('div')
.classed('sl-cell', true)
.style('width', `${cellWidth}px`)

View file

@ -8,7 +8,7 @@
import { Importer } from './importer';
export class NdjsonImporter extends Importer {
constructor(results, settings) { // eslint-disable-line no-unused-vars
constructor(results, settings) {
super(settings);
}

View file

@ -83,7 +83,7 @@ export function getQueryEntityFieldNames(job) {
entityFieldNames.push(...influencers);
}
detectors.forEach((detector, detectorIndex) => { // eslint-disable-line no-unused-vars
detectors.forEach((detector, detectorIndex) => {
const partitioningFields = getPartitioningFieldNames(job, detectorIndex);
partitioningFields.forEach((fieldName) => {
@ -341,7 +341,7 @@ export function getTestUrl(job, customUrl) {
};
// Look for bucket aggregations which match the tokens in the URL.
urlValue.replace((/\$([^?&$\'"]{1,40})\$/g), (match, name) => { // eslint-disable-line no-unused-vars
urlValue.replace((/\$([^?&$\'"]{1,40})\$/g), (match, name) => {
if (name !== 'earliest' && name !== 'latest' && firstBucket[name] !== undefined) {
const tokenBuckets = firstBucket[name];
if (tokenBuckets.buckets) {

View file

@ -153,7 +153,7 @@ class JobsListUI extends Component {
}),
sortable: true,
field: 'description',
render: (description, item) => ( // eslint-disable-line no-unused-vars
render: (description, item) => (
<JobDescription job={item} />
),
textOnly: true,
@ -199,7 +199,7 @@ class JobsListUI extends Component {
truncateText: false,
field: 'latestTimestampSortValue',
sortable: true,
render: (time, item) => ( // eslint-disable-line no-unused-vars
render: (time, item) => (
<span className="euiTableCellContent__text">
{
(item.latestTimestampMs === undefined) ? '' : moment(item.latestTimestampMs).format(TIME_FORMAT)

View file

@ -76,7 +76,7 @@ export class JobsListView extends Component {
this.props.angularWrapperScope.$on('jobsUpdated', () => {
this.refreshJobSummaryList(true);
});
this.props.angularWrapperScope.$on('openCreateWatchWindow', (e, job) => { // eslint-disable-line no-unused-vars
this.props.angularWrapperScope.$on('openCreateWatchWindow', (e, job) => {
this.showCreateWatchFlyout(job.job_id);
});

View file

@ -28,7 +28,7 @@ export class FieldSelect extends Component {
function getOptions() {
const ops = [];
_.each(options, (op, key) => { // eslint-disable-line no-unused-vars
_.each(options, (op, key) => {
ops.push({ label: key, value: key });
});
return ops;

View file

@ -131,7 +131,7 @@ export function ChartDataUtilsProvider(Private) {
)
.then((data) => {
let dtrIndex = 0;
_.each(formConfig.fields, (field, key) => { // eslint-disable-line no-unused-vars
_.each(formConfig.fields, (field, key) => {
const dtr = chartData.detectors[key];
const times = data.results[dtrIndex];

View file

@ -120,7 +120,7 @@ export const CreateWatch = injectI18n(class CreateWatch extends Component {
const { intl } = this.props;
const mlSelectSeverityService = {
state: {
set: (name, threshold) => { // eslint-disable-line no-unused-vars
set: (name, threshold) => {
this.onThresholdChange(threshold);
return {
changed: () => {}

View file

@ -351,7 +351,7 @@ module
})
.catch((resp) => {
msgs.error(resp.message);
_.each($scope.formConfig.fields, (field, id) => { // eslint-disable-line no-unused-vars
_.each($scope.formConfig.fields, (field, id) => {
$scope.chartStates.fields[id] = CHART_STATE.NO_RESULTS;
});
$scope.$applyAsync();
@ -365,7 +365,7 @@ module
chartDataUtils.loadDocCountData($scope.formConfig, $scope.chartData)
.then((resp) => {
if (thisLoadTimestamp === $scope.chartData.lastLoadTimestamp) {
_.each(dtrs, (dtr, id) => { // eslint-disable-line no-unused-vars
_.each(dtrs, (dtr, id) => {
const state = (resp.totalResults) ? CHART_STATE.LOADED : CHART_STATE.NO_RESULTS;
$scope.chartStates.fields[id] = state;
});
@ -387,7 +387,7 @@ module
};
function setFieldsChartStates(state) {
_.each($scope.chartStates.fields, (chart, key) => { // eslint-disable-line no-unused-vars
_.each($scope.chartStates.fields, (chart, key) => {
$scope.chartStates.fields[key] = state;
});
$scope.$applyAsync();

View file

@ -374,7 +374,7 @@ module
chartDataUtils.loadDocCountData($scope.formConfig, $scope.chartData)
.then((resp) => {
if (thisLoadTimestamp === $scope.chartData.lastLoadTimestamp) {
_.each(dtrs, (dtr, id) => { // eslint-disable-line no-unused-vars
_.each(dtrs, (dtr, id) => {
const state = (resp.totalResults) ? CHART_STATE.LOADED : CHART_STATE.NO_RESULTS;
$scope.chartStates.fields[id] = state;
});
@ -396,7 +396,7 @@ module
};
function setFieldsChartStates(state) {
_.each($scope.chartStates.fields, (chart, key) => { // eslint-disable-line no-unused-vars
_.each($scope.chartStates.fields, (chart, key) => {
$scope.chartStates.fields[key] = state;
});
$scope.$applyAsync();

View file

@ -69,7 +69,7 @@ export function PopulationJobServiceProvider(Private) {
fieldIds.splice(0, 0, EVENT_RATE_COUNT_FIELD);
}
fieldIds.forEach((fieldId, i) => { // eslint-disable-line no-unused-vars
fieldIds.forEach((fieldId, i) => {
this.chartData.detectors[i] = {
line: [],
swimlane: [],

View file

@ -515,7 +515,7 @@ module
// check to see if the percentage is past a threshold for reloading the full model
let fullModelRefresh = false;
_.each(jobProgressChecks, (c, i) => { // eslint-disable-line no-unused-vars
_.each(jobProgressChecks, (c, i) => {
if (jobProgressChecks[i] === false && $scope.chartData.percentComplete >= i) {
jobProgressChecks[i] = true;
fullModelRefresh = true;
@ -600,7 +600,7 @@ module
$scope.jobState = JOB_STATE.NOT_STARTED;
angular.element('.model-chart, .swimlane').css('opacity', 0);
_.each(jobProgressChecks, (c, i) => { // eslint-disable-line no-unused-vars
_.each(jobProgressChecks, (c, i) => {
jobProgressChecks[i] = false;
});

View file

@ -713,7 +713,7 @@ module.controller('MlTimeSeriesExplorerController', function (
jobSelectServiceSub.unsubscribe();
});
$scope.$on('contextChartSelected', function (event, selection) { // eslint-disable-line no-unused-vars
$scope.$on('contextChartSelected', function (event, selection) {
// Save state of zoom (adds to URL) if it is different to the default.
if (($scope.contextChartData === undefined || $scope.contextChartData.length === 0) &&
($scope.contextForecastData === undefined || $scope.contextForecastData.length === 0)) {

View file

@ -119,7 +119,7 @@ export function TimeBucketsCalcAutoIntervalProvider() {
}),
atLeast: find(revRoundingRules, function atLeast(upperBound, lowerBound, target) { // eslint-disable-line no-unused-vars
atLeast: find(revRoundingRules, function atLeast(upperBound, lowerBound, target) {
// Unmodified from Kibana ui/time_buckets/calc_auto_interval.js.
if (lowerBound <= target) {
return lowerBound;

View file

@ -6,7 +6,7 @@
export const elasticsearchJsPlugin = (Client, config, components) => { // eslint-disable-line no-unused-vars
export const elasticsearchJsPlugin = (Client, config, components) => {
const ca = components.clientAction.factory;
Client.prototype.ml = components.clientAction.namespaceFactory();

View file

@ -12,7 +12,7 @@ const INFLUENCER_LOW_THRESHOLD = 0;
const INFLUENCER_HIGH_THRESHOLD = 4;
const DETECTOR_FIELD_NAMES_THRESHOLD = 1;
export async function validateInfluencers(callWithRequest, job) { // eslint-disable-line no-unused-vars
export async function validateInfluencers(callWithRequest, job) {
validateJobObject(job);
const messages = [];

View file

@ -17,7 +17,7 @@ function generatePngObservableFn(server) {
const urlScreenshotsObservable = (url, conditionalHeaders, layout, browserTimezone) => {
return Rx.of(url).pipe(
mergeMap(url => screenshotsObservable(url, conditionalHeaders, layout, browserTimezone),
(outer, inner) => inner, // eslint-disable-line no-unused-vars
(outer, inner) => inner,
captureConcurrency
)
);

View file

@ -34,7 +34,7 @@ function generatePdfObservableFn(server) {
const urlScreenshotsObservable = (urls, conditionalHeaders, layout, browserTimezone) => {
return Rx.from(urls).pipe(
mergeMap(url => screenshotsObservable(url, conditionalHeaders, layout, browserTimezone), // eslint-disable-line no-unused-vars
mergeMap(url => screenshotsObservable(url, conditionalHeaders, layout, browserTimezone),
(outer, inner) => inner,
captureConcurrency
)

View file

@ -706,7 +706,7 @@ describe('Worker class', function () {
});
it('should update the job with the workerFn output', function () {
const workerFn = function (job, jobPayload) { // eslint-disable-line no-unused-vars
const workerFn = function (job, jobPayload) {
expect(jobPayload).to.eql(payload);
return payload;
};
@ -729,7 +729,7 @@ describe('Worker class', function () {
it('should update the job status and completed time', function () {
const startTime = moment().valueOf();
const workerFn = function (job, jobPayload) { // eslint-disable-line no-unused-vars
const workerFn = function (job, jobPayload) {
expect(jobPayload).to.eql(payload);
return new Promise(function (resolve) {
setTimeout(() => resolve(payload), 10);
@ -790,7 +790,7 @@ describe('Worker class', function () {
it('should handle async errors', function () {
const workerFn = function () {
return new Promise((resolve, reject) => { // eslint-disable-line no-unused-vars
return new Promise((resolve, reject) => {
reject(new Error('test error'));
});
};
@ -807,7 +807,7 @@ describe('Worker class', function () {
it('should handle rejecting with strings', function () {
const errorMessage = 'this is a string error';
const workerFn = function () {
return new Promise((resolve, reject) => { // eslint-disable-line no-unused-vars
return new Promise((resolve, reject) => {
reject(errorMessage);
});
};
@ -823,7 +823,7 @@ describe('Worker class', function () {
it('should handle empty rejection', function (done) {
const workerFn = function () {
return new Promise((resolve, reject) => { // eslint-disable-line no-unused-vars
return new Promise((resolve, reject) => {
reject();
});
};
@ -904,7 +904,7 @@ describe('Worker class', function () {
const timeout = 20;
cancellationCallback = function () {};
const workerFn = function (job, payload, cancellationToken) { // eslint-disable-line no-unused-vars
const workerFn = function (job, payload, cancellationToken) {
cancellationToken.on(cancellationCallback);
return new Promise(function (resolve) {
setTimeout(() => {
@ -991,7 +991,7 @@ describe('Worker class', function () {
describe('workerFn rejects promise', function () {
beforeEach(function () {
const workerFn = function () {
return new Promise(function (resolve, reject) { // eslint-disable-line no-unused-vars
return new Promise(function (resolve, reject) {
setTimeout(() => {
reject();
}, timeout / 2);

View file

@ -8,7 +8,7 @@ import { getReportingUsageCollector } from './get_reporting_usage_collector';
function getServerMock(customization) {
class MockUsageCollector {
constructor(_server, { fetch }) { // eslint-disable-line no-unused-vars
constructor(_server, { fetch }) {
this.fetch = fetch;
}
}

View file

@ -174,7 +174,7 @@ describe('Create Rollup Job, step 1: Logistics', () => {
};
const generateStringSequenceOfNumbers = (total) => (
new Array(total).fill('').map((_, i) => i < 10 ? `0${i}` : i.toString()) // eslint-disable-line no-unused-vars
new Array(total).fill('').map((_, i) => i < 10 ? `0${i}` : i.toString())
);
describe('frequency', () => {

View file

@ -114,7 +114,7 @@ export class JobCreateUi extends Component {
this._isMounted = true;
}
componentDidUpdate(prevProps, prevState) { // eslint-disable-line no-unused-vars
componentDidUpdate(prevProps, prevState) {
const indexPattern = this.getIndexPattern();
if (indexPattern !== this.getIndexPattern(prevState)) {
// If the user hasn't entered anything, then skip validation.

View file

@ -12,7 +12,7 @@ export function initAggTypeFieldFilter() {
* and limit available fields for a given aggType based on that.
*/
aggTypeFieldFilters.addFilter(
(field, fieldParamType, aggConfig) => { // eslint-disable-line no-unused-vars
(field, fieldParamType, aggConfig) => {
const indexPattern = aggConfig.getIndexPattern();
if(!indexPattern || indexPattern.type !== 'rollup') {
return true;

View file

@ -9,7 +9,7 @@ import { editorConfigProviders } from 'ui/vis/editors/config/editor_config_provi
export function initEditorConfig() {
// Limit agg params based on rollup capabilities
editorConfigProviders.register((aggType, indexPattern, aggConfig) => { // eslint-disable-line no-unused-vars
editorConfigProviders.register((aggType, indexPattern, aggConfig) => {
if(indexPattern.type !== 'rollup') {
return {};
}

View file

@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
export const elasticsearchJsPlugin = (Client, config, components) => { // eslint-disable-line no-unused-vars
export const elasticsearchJsPlugin = (Client, config, components) => {
const ca = components.clientAction.factory;
Client.prototype.rollup = components.clientAction.namespaceFactory();

View file

@ -6,7 +6,7 @@
import { getRollupSearchCapabilities } from './rollup_search_capabilities';
class DefaultSearchCapabilities {
constructor(request, fieldsCapabilities = {}) { // eslint-disable-line no-unused-vars
constructor(request, fieldsCapabilities = {}) {
this.fieldsCapabilities = fieldsCapabilities;
this.parseInterval = jest.fn((interval) => interval);
}

View file

@ -10,7 +10,7 @@ export function initLogoutView(server) {
server.route({
method: 'GET',
path: '/logout',
handler(request, h) { // eslint-disable-line no-unused-vars
handler(request, h) {
return h.renderAppWithDefaultConfig(logout);
},
config: {

View file

@ -151,7 +151,7 @@ app.directive('thresholdPreviewChart', function ($injector) {
return options;
}
onPlotHover = (event, pos, item, plot) => { // eslint-disable-line no-unused-vars
onPlotHover = (event, pos, item, plot) => {
if (!Boolean(item)) {
this.dataPointTooltip = undefined;
return;

View file

@ -56,7 +56,7 @@ app.directive('watchTable', function () {
});
}
onAllSelectedChange = (itemId, allSelected) => { // eslint-disable-line no-unused-vars
onAllSelectedChange = (itemId, allSelected) => {
_.forEach(this.editableItems, item => {
item.selected = allSelected;
});

View file

@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
export const elasticsearchJsPlugin = (Client, config, components) => { // eslint-disable-line no-unused-vars
export const elasticsearchJsPlugin = (Client, config, components) => {
const ca = components.clientAction.factory;
Client.prototype.watcher = components.clientAction.namespaceFactory();

View file

@ -32,7 +32,7 @@ function buildDateAgg({ field, interval, timeZone }) {
};
}
function buildAggsCount(body, dateAgg) { // eslint-disable-line no-unused-vars
function buildAggsCount(body, dateAgg) {
return {
dateAgg
};

View file

@ -13,7 +13,7 @@
root.ElasticsearchShield = factory();
}
}(this, function () {
return function addShieldApi(Client, config, components) { // eslint-disable-line no-unused-vars
return function addShieldApi(Client, config, components) {
const ca = components.clientAction.factory;
Client.prototype.shield = components.clientAction.namespaceFactory();

View file

@ -24,7 +24,7 @@ function convertKeysToSpecifiedCaseDeep(object, caseConversionFunction) {
newObject = _.clone(object);
// Convert top-level keys
newObject = _.mapKeys(newObject, (value, key) => caseConversionFunction(key)); // eslint-disable-line no-unused-vars
newObject = _.mapKeys(newObject, (value, key) => caseConversionFunction(key));
}
// Recursively convert nested object keys

View file

@ -7,7 +7,7 @@
export function mirrorPluginStatus(upstreamPlugin, downstreamPlugin, ...statesToMirror) {
upstreamPlugin.status.setMaxListeners(20); // We need more than the default, which is 10
function mirror(previousState, previousMsg, newState, newMsg) { // eslint-disable-line no-unused-vars
function mirror(previousState, previousMsg, newState, newMsg) {
if (newState) {
downstreamPlugin.status[newState](newMsg);
}

View file

@ -42,7 +42,7 @@ export function watchStatusAndLicenseToInitialize(xpackMainPlugin, downstreamPlu
message: upstreamStatus.message,
});
const newStatus$ = Rx
.fromEvent(upstreamStatus, 'change', null, (previousState, previousMsg, state, message) => { // eslint-disable-line no-unused-vars
.fromEvent(upstreamStatus, 'change', null, (previousState, previousMsg, state, message) => {
return {
state,
message,

View file

@ -87,7 +87,7 @@ export default function ({ getService, getPageObjects }) {
const alertsAll = await alerts.getOverviewAlertsAll();
alertsAll.forEach((obj, index) => { // eslint-disable-line no-unused-vars
alertsAll.forEach((obj, index) => {
expect(alertsAll[index].alertIcon).to.be(panelData[index].alertIcon);
expect(alertsAll[index].alertText).to.be(panelData[index].alertText);
});
@ -152,7 +152,7 @@ export default function ({ getService, getPageObjects }) {
));
expect(alertsAll.length).to.be(tableData.length);
alertsAll.forEach((obj, index) => { // eslint-disable-line no-unused-vars
alertsAll.forEach((obj, index) => {
expect(`${alertsAll[index].alertIcon} ${alertsAll[index].alertText}`)
.to.be(`${tableData[index].alertIcon} ${tableData[index].alertText}`);
});

View file

@ -77,7 +77,7 @@ export default function ({ getService, getPageObjects }) {
]; /*eslint-enable*/
// check the all data in the table
indicesAll.forEach((obj, index) => { // eslint-disable-line no-unused-vars
indicesAll.forEach((obj, index) => {
expect(indicesAll[index].name).to.be(tableData[index].name);
expect(indicesAll[index].status).to.be(tableData[index].status);
expect(indicesAll[index].documentCount).to.be(tableData[index].documentCount);

View file

@ -77,7 +77,7 @@ export default function ({ getService, getPageObjects }) {
},
{ name: 'whatever-03', status: 'Status: Offline' },
];
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
nodesAll.forEach((obj, node) => {
expect(nodesAll[node].name).to.be(tableData[node].name);
expect(nodesAll[node].status).to.be(tableData[node].status);
expect(nodesAll[node].cpu).to.be(tableData[node].cpu);
@ -94,7 +94,7 @@ export default function ({ getService, getPageObjects }) {
const nodesAll = await nodesList.getNodesAll();
const tableData = [{ cpu: '2% \n3% max\n0% min' }, { cpu: '0% \n3% max\n0% min' }, { cpu: undefined }];
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
nodesAll.forEach((obj, node) => {
expect(nodesAll[node].cpu).to.be(tableData[node].cpu);
});
});
@ -109,7 +109,7 @@ export default function ({ getService, getPageObjects }) {
{ load: '3.28 \n3.73 max\n2.29 min' },
{ load: undefined },
];
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
nodesAll.forEach((obj, node) => {
expect(nodesAll[node].load).to.be(tableData[node].load);
});
});
@ -125,7 +125,7 @@ export default function ({ getService, getPageObjects }) {
{ name: 'whatever-02' },
{ name: 'whatever-03' },
];
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
nodesAll.forEach((obj, node) => {
expect(nodesAll[node].name).to.be(tableData[node].name);
});
});
@ -140,7 +140,7 @@ export default function ({ getService, getPageObjects }) {
{ status: 'Status: Online' },
{ status: 'Status: Offline' },
];
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
nodesAll.forEach((obj, node) => {
expect(nodesAll[node].status).to.be(tableData[node].status);
});
});
@ -155,7 +155,7 @@ export default function ({ getService, getPageObjects }) {
{ memory: '25% \n49% max\n25% min' },
{ memory: undefined },
];
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
nodesAll.forEach((obj, node) => {
expect(nodesAll[node].memory).to.be(tableData[node].memory);
});
});
@ -170,7 +170,7 @@ export default function ({ getService, getPageObjects }) {
{ disk: '173.9 GB \n173.9 GB max\n173.9 GB min' },
{ disk: undefined },
];
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
nodesAll.forEach((obj, node) => {
expect(nodesAll[node].disk).to.be(tableData[node].disk);
});
});
@ -185,7 +185,7 @@ export default function ({ getService, getPageObjects }) {
{ shards: '38' },
{ shards: undefined },
];
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
nodesAll.forEach((obj, node) => {
expect(nodesAll[node].shards).to.be(tableData[node].shards);
});
});

View file

@ -53,7 +53,7 @@ export default function ({ getService, getPageObjects }) {
];
// check the all data in the table
pipelinesAll.forEach((obj, index) => { // eslint-disable-line no-unused-vars
pipelinesAll.forEach((obj, index) => {
expect(pipelinesAll[index].id).to.be(tableData[index].id);
expect(pipelinesAll[index].eventsEmittedRate).to.be(tableData[index].eventsEmittedRate);
expect(pipelinesAll[index].nodeCount).to.be(tableData[index].nodeCount);
@ -76,7 +76,7 @@ export default function ({ getService, getPageObjects }) {
];
// check the all data in the table
pipelinesAll.forEach((obj, index) => { // eslint-disable-line no-unused-vars
pipelinesAll.forEach((obj, index) => {
expect(pipelinesAll[index].id).to.be(tableData[index].id);
expect(pipelinesAll[index].eventsEmittedRate).to.be(tableData[index].eventsEmittedRate);
expect(pipelinesAll[index].nodeCount).to.be(tableData[index].nodeCount);