Fix linting issues (#54068)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Chris Roberson 2020-01-07 11:31:15 -05:00 committed by GitHub
parent c02531a494
commit 28b6efa260
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 18 additions and 33 deletions

View file

@ -177,12 +177,6 @@ module.exports = {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/legacy/plugins/monitoring/**/*.{js,ts,tsx}'],
rules: {
'jsx-a11y/click-events-have-key-events': 'off',
},
},
{
files: ['x-pack/legacy/plugins/snapshot_restore/**/*.{js,ts,tsx}'],
rules: {
@ -814,21 +808,6 @@ module.exports = {
},
},
/**
* Monitoring overrides
*/
{
files: ['x-pack/legacy/plugins/monitoring/**/*.js'],
rules: {
'no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }],
'no-else-return': 'error',
},
},
{
files: ['x-pack/legacy/plugins/monitoring/public/**/*.js'],
env: { browser: true },
},
/**
* Canvas overrides
*/

View file

@ -22,7 +22,7 @@ export const monitoring = kibana =>
id: 'monitoring',
configPrefix: 'xpack.monitoring',
publicDir: resolve(__dirname, 'public'),
init(server, _options) {
init(server) {
const configs = [
'xpack.monitoring.ui.enabled',
'xpack.monitoring.kibana.collection.enabled',

View file

@ -46,7 +46,7 @@ export class ChartTarget extends React.Component {
return seriesToShow.some(id => id.toLowerCase() === metric.id.toLowerCase());
};
}
return _metric => true;
return () => true;
}
UNSAFE_componentWillReceiveProps(newProps) {

View file

@ -38,8 +38,8 @@ const props = {
max: 1562962539851,
},
hasLegend: true,
onBrush: _ => void 0,
tickFormatter: _ => void 0,
onBrush: () => void 0,
tickFormatter: () => void 0,
updateLegend: () => void 0,
};

View file

@ -46,6 +46,8 @@ export class Assigned extends React.Component {
// TODO: redesign for shard allocation, possibly giving shard display the
// ability to use the euiLink CSS class (blue link text instead of white link text)
// Disabling eslint because EuiKeyboardAccessible does it for us
/* eslint-disable jsx-a11y/click-events-have-key-events */
const name = (
<EuiKeyboardAccessible>
<a onClick={changeUrl}>
@ -53,6 +55,7 @@ export class Assigned extends React.Component {
</a>
</EuiKeyboardAccessible>
);
/* eslint-enable jsx-a11y/click-events-have-key-events */
const master =
data.node_type === 'master' ? <EuiIcon type="starFilledSpace" color="primary" /> : null;
const shards = sortBy(data.children, 'shard').map(this.createShard);

View file

@ -164,7 +164,7 @@ function renderPluginBasicStats(vertex, timeseriesTooltipXValueFormatter) {
);
}
function renderIfBasicStats(_vertex) {
function renderIfBasicStats() {
return (
<p>
<FormattedMessage
@ -175,7 +175,7 @@ function renderIfBasicStats(_vertex) {
);
}
function renderQueueBasicStats(_vertex) {
function renderQueueBasicStats() {
return (
<p>
<FormattedMessage
@ -253,7 +253,7 @@ function renderIfBasicInfo(vertex) {
);
}
function renderQueueBasicInfo(_vertex) {
function renderQueueBasicInfo() {
return (
<p>
<FormattedMessage

View file

@ -72,7 +72,7 @@ export function executorProvider(Promise, $timeout) {
).finally(reset);
}
function reFetch(_changes) {
function reFetch() {
cancel();
run();
}

View file

@ -39,6 +39,7 @@ uiRoutes.when('/elasticsearch/nodes', {
}) || {};
const getPageData = ($injector, _api = undefined, routeOptions = {}) => {
_api; // to fix eslint
const $http = $injector.get('$http');
const globalState = $injector.get('globalState');
const timeBounds = timefilter.getBounds();

View file

@ -23,6 +23,7 @@ import { DetailStatus } from '../../../../components/logstash/detail_status';
import { CODE_PATH_LOGSTASH } from '../../../../../common/constants';
const getPageData = ($injector, _api = undefined, routeOptions = {}) => {
_api; // fixing eslint
const $route = $injector.get('$route');
const $http = $injector.get('$http');
const globalState = $injector.get('globalState');

View file

@ -23,6 +23,7 @@ import { CODE_PATH_LOGSTASH } from '../../../../common/constants';
*/
const getPageData = ($injector, _api = undefined, routeOptions = {}) => {
_api; // to fix eslint
const $http = $injector.get('$http');
const globalState = $injector.get('globalState');
const Private = $injector.get('Private');

View file

@ -48,7 +48,7 @@ export class CloudService {
* @param {Object} _request 'request' HTTP handler.
* @return {Promise} Never {@code null} {@code CloudServiceResponse}.
*/
_checkIfService(_request) {
_checkIfService() {
return Promise.reject(new Error('not implemented'));
}

View file

@ -116,7 +116,7 @@ export class LatencyMetric extends ElasticsearchMetric {
},
};
this.calculation = (bucket, _key, _metric, _bucketSizeInSeconds) => {
this.calculation = bucket => {
const timeInMillisDeriv = _.get(bucket, 'event_time_in_millis_deriv.normalized_value', null);
const totalEventsDeriv = _.get(bucket, 'event_total_deriv.normalized_value', null);

View file

@ -90,7 +90,7 @@ export class LogstashEventsLatencyClusterMetric extends LogstashClusterMetric {
},
};
this.calculation = (bucket, _key, _metric, _bucketSizeInSeconds) => {
this.calculation = bucket => {
const timeInMillisDeriv = _.get(bucket, 'events_time_in_millis_deriv.normalized_value', null);
const totalEventsDeriv = _.get(bucket, 'events_total_deriv.normalized_value', null);
@ -189,7 +189,7 @@ export class LogstashEventsLatencyMetric extends LogstashMetric {
},
};
this.calculation = (bucket, _key, _metric, _bucketSizeInSeconds) => {
this.calculation = bucket => {
const timeInMillisDeriv = _.get(bucket, 'events_time_in_millis_deriv.normalized_value', null);
const totalEventsDeriv = _.get(bucket, 'events_total_deriv.normalized_value', null);