Skip to content

Commit

Permalink
Fix linting issues (#54068) (#54142)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
chrisronline and elasticmachine authored Jan 7, 2020
1 parent c56cce5 commit 98cad29
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 33 deletions.
21 changes: 0 additions & 21 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,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: {
Expand Down Expand Up @@ -827,21 +821,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
*/
Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/monitoring/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ 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}>
<span>{data.name}</span>
</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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function renderPluginBasicStats(vertex, timeseriesTooltipXValueFormatter) {
);
}

function renderIfBasicStats(_vertex) {
function renderIfBasicStats() {
return (
<p>
<FormattedMessage
Expand All @@ -175,7 +175,7 @@ function renderIfBasicStats(_vertex) {
);
}

function renderQueueBasicStats(_vertex) {
function renderQueueBasicStats() {
return (
<p>
<FormattedMessage
Expand Down Expand Up @@ -253,7 +253,7 @@ function renderIfBasicInfo(vertex) {
);
}

function renderQueueBasicInfo(_vertex) {
function renderQueueBasicInfo() {
return (
<p>
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function executorProvider(Promise, $timeout) {
).finally(reset);
}

function reFetch(_changes) {
function reFetch() {
cancel();
run();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 98cad29

Please sign in to comment.