Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update versions of eslint, @babel/parser and @babel/types #23268

Merged
merged 11 commits into from
Sep 25, 2018
6 changes: 3 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ module.exports = {
'import/no-extraneous-dependencies': [
'error',
{
packageDir: resolve(__dirname, 'x-pack/package.json'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: do you really need to do all these changes in this file? The less changes we make, the better (if possible).

packageDir: './x-pack/',
},
],
},
Expand All @@ -417,7 +417,7 @@ module.exports = {
{
devDependencies: true,
peerDependencies: true,
packageDir: resolve(__dirname, 'x-pack/package.json'),
packageDir: './x-pack/',
},
],
},
Expand All @@ -429,7 +429,7 @@ module.exports = {
'import/no-extraneous-dependencies': [
'error',
{
packageDir: resolve(__dirname, 'x-pack/package.json'),
packageDir: './x-pack/',
},
],
'import/no-unresolved': [
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@
"yauzl": "2.7.0"
},
"devDependencies": {
"@babel/parser": "7.0.0-beta.52",
"@babel/types": "7.0.0-beta.31",
"@babel/parser": "^7.1.0",
"@babel/types": "^7.0.0",
"@elastic/eslint-config-kibana": "link:packages/eslint-config-kibana",
"@elastic/eslint-plugin-kibana-custom": "link:packages/eslint-plugin-kibana-custom",
"@kbn/es": "link:packages/kbn-es",
Expand Down Expand Up @@ -249,7 +249,7 @@
"@types/type-detect": "^4.0.1",
"@types/uuid": "^3.4.4",
"angular-mocks": "1.4.7",
"babel-eslint": "8.1.2",
"babel-eslint": "^9.0.0",
"babel-jest": "^23.4.2",
"backport": "4.4.1",
"chai": "3.5.0",
Expand All @@ -262,7 +262,7 @@
"enzyme": "3.2.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-to-json": "3.3.1",
"eslint": "4.14.0",
"eslint": "^5.6.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-babel": "4.1.2",
"eslint-plugin-import": "2.8.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-kibana/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
],

env: {
'jest/globals': true,
'jest': true,
},

rules: {
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-kibana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
},
"homepage": "https://github.com/elastic/eslint-config-kibana#readme",
"peerDependencies": {
"babel-eslint": "^8.0.0",
"eslint": "^4.1.0",
"babel-eslint": "^9.0.0",
"eslint": "^5.6.0",
"eslint-plugin-babel": "^4.1.1",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jest": "^21.22.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-eslint-plugin-license-header/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"private": true,
"license": "Apache-2.0",
"peerDependencies": {
"eslint": ">=4.0.0",
"babel-eslint": "^8.2.1"
"eslint": "^5.6.0",
"babel-eslint": "^9.0.0"
},
"dependencies": {
"dedent": "^0.7.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"@elastic/eslint-config-kibana": "link:../../kibana/packages/eslint-config-kibana",
"@elastic/eslint-import-resolver-kibana": "link:../../kibana/packages/kbn-eslint-import-resolver-kibana",
"@kbn/plugin-helpers": "link:../../kibana/packages/kbn-plugin-helpers",
"babel-eslint": "^8.0.2",
"eslint": "^4.11.0",
"babel-eslint": "^9.0.0",
"eslint": "^5.6.0",
"eslint-plugin-babel": "^4.1.1",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-jest": "^21.22.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function InputHighlightRules() {
{ token: 'paren.lparen', regex: '{', next: 'json', push: true }
],
addEOL(['method'], /([a-zA-Z]+)/, 'start', 'method_sep')
,
,
[
{
token: 'whitespace',
Expand Down
72 changes: 36 additions & 36 deletions src/core_plugins/kibana/public/discover/controllers/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,45 +460,45 @@ function discoverController(
'rows',
'fetchStatus'
], (function updateResultState() {
let prev = {};
const status = {
LOADING: 'loading', // initial data load
READY: 'ready', // results came back
NO_RESULTS: 'none' // no results came back
};

function pick(rows, oldRows, fetchStatus) {
// initial state, pretend we are loading
if (rows == null && oldRows == null) return status.LOADING;

const rowsEmpty = _.isEmpty(rows);
// An undefined fetchStatus means the requests are still being
// prepared to be sent. When all requests are completed,
// fetchStatus is set to null, so it's important that we
// specifically check for undefined to determine a loading status.
const preparingForFetch = _.isUndefined(fetchStatus);
if (preparingForFetch) return status.LOADING;
else if (rowsEmpty && fetchStatus) return status.LOADING;
else if (!rowsEmpty) return status.READY;
else return status.NO_RESULTS;
}
let prev = {};
const status = {
LOADING: 'loading', // initial data load
READY: 'ready', // results came back
NO_RESULTS: 'none' // no results came back
};

function pick(rows, oldRows, fetchStatus) {
// initial state, pretend we are loading
if (rows == null && oldRows == null) return status.LOADING;

const rowsEmpty = _.isEmpty(rows);
// An undefined fetchStatus means the requests are still being
// prepared to be sent. When all requests are completed,
// fetchStatus is set to null, so it's important that we
// specifically check for undefined to determine a loading status.
const preparingForFetch = _.isUndefined(fetchStatus);
if (preparingForFetch) return status.LOADING;
else if (rowsEmpty && fetchStatus) return status.LOADING;
else if (!rowsEmpty) return status.READY;
else return status.NO_RESULTS;
}

return function () {
const current = {
rows: $scope.rows,
fetchStatus: $scope.fetchStatus
};
return function () {
const current = {
rows: $scope.rows,
fetchStatus: $scope.fetchStatus
};

$scope.resultState = pick(
current.rows,
prev.rows,
current.fetchStatus,
prev.fetchStatus
);
$scope.resultState = pick(
current.rows,
prev.rows,
current.fetchStatus,
prev.fetchStatus
);

prev = current;
};
}()));
prev = current;
};
}()));

if ($scope.opts.timefield) {
setupVisualization();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function mockRawData() {
do {
node = stack.pop();
if (typeof node === 'object') {
// eslint-disable-next-line guard-for-in
for (const key in node) {
if (node.hasOwnProperty(key)) {
if (key === 'aggConfig') {
Expand Down
Empty file removed src/fixtures/require_from.js
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion src/ui/public/private/private.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ uiModules.get('kibana/private')

provider.$get = ['$injector', function PrivateFactory($injector) {

// prevent circular deps by tracking where we came from
// prevent circular deps by tracking where we came from
const privPath = [];
const pathToString = function () {
return privPath.map(name).join(' -> ');
Expand Down
Empty file.
5 changes: 3 additions & 2 deletions test/functional/page_objects/visualize_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,9 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
log.debug(`maxYLabel = ${maxYLabel}, maxYLabelYPosition = ${maxYLabelYPosition}`);

// 2). get the minimum chart Y-Axis marker value and Y position
const minYAxisChartMarker = await
find.byCssSelector('div.y-axis-col.axis-wrapper-left > div > div > svg:nth-child(2) > g > g:nth-child(1).tick');
const minYAxisChartMarker = await find.byCssSelector(
'div.y-axis-col.axis-wrapper-left > div > div > svg:nth-child(2) > g > g:nth-child(1).tick'
);
const minYLabel = (await minYAxisChartMarker.getVisibleText()).replace(',', '');
const minYLabelYPosition = (await minYAxisChartMarker.getPosition()).y;
return ((maxYLabel - minYLabel) / (minYLabelYPosition - maxYLabelYPosition));
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/canvas/tasks/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

// eslint-disable-next-line import/no-extraneous-dependencies
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: hmm, this is handled by canvas-dedicated section in .eslintrc.js, I don't think you need to add manually, correct?

import webpack from 'webpack';
import webpackConfig from './helpers/webpack.plugins';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import axios from 'axios';
import { setHttpClient } from '../../public/services/api';
import sinon from 'sinon';
import { findTestSubject } from '@elastic/eui/lib/test';

jest.mock('react-ace', () => {
const { PureComponent } = require('react');
return class extends PureComponent {
Expand All @@ -33,6 +34,7 @@ jest.mock('react-ace', () => {
};
});
jest.mock('brace/theme/textmate', () => 'brace/theme/textmate');
jest.mock('brace/ext/language_tools', () => 'brace/ext/language_tools');

setHttpClient(axios.create());
let server = null;
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export const rowStatus = handleActions({
}, {});

const newState = { ...state };
// eslint-disable-next-line guard-for-in
pavel06081991 marked this conversation as resolved.
Show resolved Hide resolved
for (const indexName in state) {
if (state[indexName] === INDEX_CLOSING && indicesByName[indexName].status === INDEX_CLOSED) {
delete newState[indexName];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ module.controller('MlJobsList',
job.job_id.match(filterRegexp) ||
jobDescription.match(filterRegexp)) {

// long string moved to separate variable to allow it to be broken in two
// long string moved to separate variable to allow it to be broken in two
let iconTxt = '<i ng-show="tab.jobWarningClass !== \'\'" ';
iconTxt += 'tooltip="{{jobAudit.jobWarningText}}" class="{{jobAudit.jobWarningClass}}"></i>';

Expand Down Expand Up @@ -594,7 +594,7 @@ module.controller('MlJobsList',
// apply the text entered in the filter field and reload the jobs list
$scope.applyFilter = function () {

// clear the previous filter timeout
// clear the previous filter timeout
$timeout.cancel(jobFilterTimeout);

// create a timeout to redraw the jobs list based on the filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -758,8 +758,8 @@ module.controller('MlNewJob',
function setFieldDelimiterControlsFromText() {
if ($scope.job.data_description && $scope.job.data_description.field_delimiter) {

// if the data format has not been set and fieldDelimiter exists,
// assume the format is delimited
// if the data format has not been set and fieldDelimiter exists,
// assume the format is delimited
if ($scope.job.data_description.format === undefined) {
$scope.job.data_description.format = 'delimited';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function safeChildProcess(childProcess, observer) {
),
);

// send termination signals
// send termination signals
const terminate$ = Rx.merge(
signalForChildProcess$.pipe(
tap(signal => childProcess.kill(signal))
Expand Down
7 changes: 4 additions & 3 deletions x-pack/plugins/searchprofiler/public/filters/ns_to_pretty.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ export function nsToPretty(ns, precision) {
precision = 1;
}
const units = ['ns', 'µs'];
for (const i in units) {

for (const unit of units) {
if (ns < 1000) {
return ns.toFixed(precision) + units[i];
return ns.toFixed(precision) + unit;
}
ns /= 1000;
}
return msToPretty(ns, precision);
}
}
2 changes: 1 addition & 1 deletion x-pack/plugins/security/public/views/management/roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ routes.when(ROLES_PATH, {
};
confirmModal(`
Are you sure you want to delete the selected role(s)? This action is irreversible!`,
confirmModalOptions
confirmModalOptions
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function registerLoadRoute(server) {
})
.catch(err => {

// Case: Error from Elasticsearch JS client
// Case: Error from Elasticsearch JS client
if (isEsError(err)) {
return reply(wrapEsError(err));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function registerAcknowledgeRoute(server) {
})
.catch(err => {

// Case: Error from Elasticsearch JS client
// Case: Error from Elasticsearch JS client
if (isEsError(err)) {
const statusCodeToMessageMap = {
404: `Watch with id = ${watchId} not found`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function registerActivateRoute(server) {
})
.catch(err => {

// Case: Error from Elasticsearch JS client
// Case: Error from Elasticsearch JS client
if (isEsError(err)) {
const statusCodeToMessageMap = {
404: `Watch with id = ${watchId} not found`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function registerDeactivateRoute(server) {
})
.catch(err => {

// Case: Error from Elasticsearch JS client
// Case: Error from Elasticsearch JS client
if (isEsError(err)) {
const statusCodeToMessageMap = {
404: `Watch with id = ${watchId} not found`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function registerDeleteRoute(server) {
.then(() => reply().code(204))
.catch(err => {

// Case: Error from Elasticsearch JS client
// Case: Error from Elasticsearch JS client
if (isEsError(err)) {
const statusCodeToMessageMap = {
404: `Watch with id = ${watchId} not found`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function registerExecuteRoute(server) {
})
.catch(err => {

// Case: Error from Elasticsearch JS client
// Case: Error from Elasticsearch JS client
if (isEsError(err)) {
return reply(wrapEsError(err));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function registerLoadRoute(server) {
})
.catch(err => {

// Case: Error from Elasticsearch JS client
// Case: Error from Elasticsearch JS client
if (isEsError(err)) {
const statusCodeToMessageMap = {
404: `Watch with id = ${id} not found`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function registerSaveRoute(server) {
.then(reply)
.catch(err => {

// Case: Error from Elasticsearch JS client
// Case: Error from Elasticsearch JS client
if (isEsError(err)) {
return reply(wrapEsError(err));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function registerVisualizeRoute(server) {
})
.catch(err => {

// Case: Error from Elasticsearch JS client
// Case: Error from Elasticsearch JS client
if (isEsError(err)) {
return reply(wrapEsError(err));
}
Expand Down
Loading