mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* [eslint] upgrade to latest eslint-config-kibana
* [eslint] autofix violations discovered by updated rules
* [eslint] remove import resolver
(cherry picked from commit 14014872aa
)
This commit is contained in:
parent
2c772409ab
commit
d397a22d0e
12 changed files with 66 additions and 55 deletions
10
.eslintrc
10
.eslintrc
|
@ -1,2 +1,12 @@
|
|||
---
|
||||
extends: '@elastic/kibana'
|
||||
|
||||
rules:
|
||||
import/no-unresolved: off
|
||||
import/named: off
|
||||
import/namespace: off
|
||||
import/default: off
|
||||
import/export: off
|
||||
import/no-named-as-default: off
|
||||
import/no-named-as-default-member: off
|
||||
import/no-duplicates: off
|
||||
|
|
13
package.json
13
package.json
|
@ -202,11 +202,11 @@
|
|||
"yauzl": "2.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@elastic/eslint-config-kibana": "0.5.0",
|
||||
"@elastic/eslint-config-kibana": "0.6.1",
|
||||
"@elastic/eslint-plugin-kibana-custom": "1.0.3",
|
||||
"angular-mocks": "1.4.7",
|
||||
"auto-release-sinon": "1.0.3",
|
||||
"babel-eslint": "6.1.2",
|
||||
"babel-eslint": "7.2.3",
|
||||
"chai": "3.5.0",
|
||||
"chance": "1.0.6",
|
||||
"cheerio": "0.22.0",
|
||||
|
@ -215,11 +215,12 @@
|
|||
"classnames": "2.2.5",
|
||||
"enzyme": "2.7.0",
|
||||
"enzyme-to-json": "1.4.5",
|
||||
"eslint": "3.11.1",
|
||||
"eslint-plugin-babel": "4.0.0",
|
||||
"eslint": "3.19.0",
|
||||
"eslint-plugin-babel": "4.1.1",
|
||||
"eslint-plugin-import": "2.3.0",
|
||||
"eslint-plugin-jest": "20.0.0",
|
||||
"eslint-plugin-mocha": "4.7.0",
|
||||
"eslint-plugin-react": "6.10.3",
|
||||
"eslint-plugin-mocha": "4.9.0",
|
||||
"eslint-plugin-react": "7.0.1",
|
||||
"event-stream": "3.3.2",
|
||||
"expect.js": "0.3.1",
|
||||
"faker": "1.1.0",
|
||||
|
|
|
@ -11,7 +11,7 @@ function compatibleWithKibana(kbnServer, plugin) {
|
|||
return versionSatisfies(pluginKibanaVersion, kibanaVersion);
|
||||
}
|
||||
|
||||
export default async function(kbnServer, server) {
|
||||
export default async function (kbnServer, server) {
|
||||
//because a plugin pack can contain more than one actual plugin, (for example x-pack)
|
||||
//we make sure that the warning messages are unique
|
||||
const warningMessages = new Set();
|
||||
|
|
|
@ -21,12 +21,12 @@ describe('service_settings (FKA tilemaptest)', function () {
|
|||
'manifest': tmsManifestUrl,
|
||||
'type': 'tms'
|
||||
},
|
||||
{
|
||||
'id': 'geo_layers',
|
||||
'name': 'Elastic Layer Service',
|
||||
'manifest': vectorManifestUrl,
|
||||
'type': 'file'
|
||||
}
|
||||
{
|
||||
'id': 'geo_layers',
|
||||
'name': 'Elastic Layer Service',
|
||||
'manifest': vectorManifestUrl,
|
||||
'type': 'file'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
const PageObjects = getPageObjects(['common', 'header', 'discover']);
|
||||
|
||||
describe('context link in discover', function contextSize() {
|
||||
before(async function() {
|
||||
before(async function () {
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
await PageObjects.header.setAbsoluteRange(TEST_DISCOVER_START_TIME, TEST_DISCOVER_END_TIME);
|
||||
await Promise.all(TEST_COLUMN_NAMES.map((columnName) => (
|
||||
|
|
|
@ -13,7 +13,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
const PageObjects = getPageObjects(['common', 'context']);
|
||||
|
||||
describe('context filters', function contextSize() {
|
||||
before(async function() {
|
||||
before(async function () {
|
||||
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_TYPE, TEST_ANCHOR_ID, {
|
||||
columns: TEST_COLUMN_NAMES,
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
const PageObjects = getPageObjects(['context']);
|
||||
|
||||
describe('context size', function contextSize() {
|
||||
before(async function() {
|
||||
before(async function () {
|
||||
await kibanaServer.uiSettings.update({
|
||||
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
|
||||
'context:step': `${TEST_STEP_SIZE}`,
|
||||
|
@ -28,17 +28,17 @@ export default function ({ getService, getPageObjects }) {
|
|||
await retry.try(async function () {
|
||||
expect(await docTable.getBodyRows(table)).to.have.length(2 * TEST_DEFAULT_CONTEXT_SIZE + 1);
|
||||
});
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
const predecessorCountPicker = await PageObjects.context.getPredecessorCountPicker();
|
||||
expect(await predecessorCountPicker.getProperty('value')).to.equal(`${TEST_DEFAULT_CONTEXT_SIZE}`);
|
||||
});
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
const successorCountPicker = await PageObjects.context.getSuccessorCountPicker();
|
||||
expect(await successorCountPicker.getProperty('value')).to.equal(`${TEST_DEFAULT_CONTEXT_SIZE}`);
|
||||
});
|
||||
});
|
||||
|
||||
it('should increase according to the `context:step` setting when clicking the `load newer` button', async function() {
|
||||
it('should increase according to the `context:step` setting when clicking the `load newer` button', async function () {
|
||||
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_TYPE, TEST_ANCHOR_ID);
|
||||
|
||||
const table = await docTable.getTable();
|
||||
|
@ -50,7 +50,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
});
|
||||
});
|
||||
|
||||
it('should increase according to the `context:step` setting when clicking the `load older` button', async function() {
|
||||
it('should increase according to the `context:step` setting when clicking the `load older` button', async function () {
|
||||
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_TYPE, TEST_ANCHOR_ID);
|
||||
|
||||
const table = await docTable.getTable();
|
||||
|
|
|
@ -14,7 +14,7 @@ export default function ({ getPageObjects }) {
|
|||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
||||
});
|
||||
|
||||
it('warns on duplicate name for new dashboard', async function() {
|
||||
it('warns on duplicate name for new dashboard', async function () {
|
||||
await PageObjects.dashboard.clickNewDashboard();
|
||||
await PageObjects.dashboard.saveDashboard(dashboardName);
|
||||
await PageObjects.header.clickToastOK();
|
||||
|
@ -30,14 +30,14 @@ export default function ({ getPageObjects }) {
|
|||
expect(isConfirmOpen).to.equal(true);
|
||||
});
|
||||
|
||||
it('does not save on reject confirmation', async function() {
|
||||
it('does not save on reject confirmation', async function () {
|
||||
await PageObjects.common.clickCancelOnModal();
|
||||
|
||||
const countOfDashboards = await PageObjects.dashboard.getDashboardCountWithName(dashboardName);
|
||||
expect(countOfDashboards).to.equal(1);
|
||||
});
|
||||
|
||||
it('Saves on confirm duplicate title warning', async function() {
|
||||
it('Saves on confirm duplicate title warning', async function () {
|
||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
||||
await PageObjects.dashboard.clickNewDashboard();
|
||||
await PageObjects.dashboard.enterDashboardTitleAndClickSave(dashboardName);
|
||||
|
@ -55,7 +55,7 @@ export default function ({ getPageObjects }) {
|
|||
});
|
||||
|
||||
it('Does not warn when you save an existing dashboard with the title it already has, and that title is a duplicate',
|
||||
async function() {
|
||||
async function () {
|
||||
await PageObjects.dashboard.clickDashboardByLinkText(dashboardName);
|
||||
await PageObjects.header.isGlobalLoadingIndicatorHidden();
|
||||
await PageObjects.dashboard.clickEdit();
|
||||
|
@ -67,7 +67,7 @@ export default function ({ getPageObjects }) {
|
|||
}
|
||||
);
|
||||
|
||||
it('Warns you when you Save as New Dashboard, and the title is a duplicate', async function() {
|
||||
it('Warns you when you Save as New Dashboard, and the title is a duplicate', async function () {
|
||||
await PageObjects.dashboard.clickEdit();
|
||||
await PageObjects.dashboard.enterDashboardTitleAndClickSave(dashboardName, { saveAsNew: true });
|
||||
|
||||
|
@ -77,14 +77,14 @@ export default function ({ getPageObjects }) {
|
|||
await PageObjects.common.clickCancelOnModal();
|
||||
});
|
||||
|
||||
it('Does not warn when only the prefix matches', async function() {
|
||||
it('Does not warn when only the prefix matches', async function () {
|
||||
await PageObjects.dashboard.saveDashboard(dashboardName.split(' ')[0]);
|
||||
|
||||
const isConfirmOpen = await PageObjects.common.isConfirmModalOpen();
|
||||
expect(isConfirmOpen).to.equal(false);
|
||||
});
|
||||
|
||||
it('Warns when case is different', async function() {
|
||||
it('Warns when case is different', async function () {
|
||||
await PageObjects.dashboard.clickEdit();
|
||||
await PageObjects.dashboard.enterDashboardTitleAndClickSave(dashboardName.toUpperCase());
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
it('load query should show query name', async function () {
|
||||
await PageObjects.discover.loadSavedSearch(queryName1);
|
||||
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
expect(await PageObjects.discover.getCurrentQueryName()).to.be(queryName1);
|
||||
});
|
||||
await screenshots.take('Discover-load-query');
|
||||
|
@ -68,7 +68,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
it('should show the correct hit count', async function () {
|
||||
const expectedHitCount = '14,004';
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
expect(await PageObjects.discover.getHitCount()).to.be(expectedHitCount);
|
||||
});
|
||||
});
|
||||
|
@ -217,7 +217,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
expect(isVisible).to.be(true);
|
||||
});
|
||||
|
||||
it('should have a link that opens and closes the time picker', async function() {
|
||||
it('should have a link that opens and closes the time picker', async function () {
|
||||
const noResultsTimepickerLink = await PageObjects.discover.getNoResultsTimepicker();
|
||||
expect(await PageObjects.header.isTimepickerOpen()).to.be(false);
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
await PageObjects.settings.setFieldTypeFilter('string');
|
||||
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
const fieldTypes = await PageObjects.settings.getFieldTypes();
|
||||
expect(fieldTypes.length).to.be.above(0);
|
||||
for (const fieldType of fieldTypes) {
|
||||
|
@ -42,7 +42,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
await PageObjects.settings.setFieldTypeFilter('number');
|
||||
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
const fieldTypes = await PageObjects.settings.getFieldTypes();
|
||||
expect(fieldTypes.length).to.be.above(0);
|
||||
for (const fieldType of fieldTypes) {
|
||||
|
|
|
@ -52,7 +52,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
.addScriptedField(scriptedExpressionFieldName,
|
||||
'expression', 'number', null, '1', 'doc[\'machine.ram\'].value / (1024 * 1024 * 1024)'
|
||||
);
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount())).to.be(startingCount + 1);
|
||||
});
|
||||
});
|
||||
|
@ -66,12 +66,12 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await PageObjects.discover.clickFieldListItem(scriptedExpressionFieldName);
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
await PageObjects.discover.clickFieldListItemAdd(scriptedExpressionFieldName);
|
||||
});
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
const rowData = await PageObjects.discover.getDocTableIndex(1);
|
||||
expect(rowData).to.be('September 18th 2015, 18:20:57.916\n18');
|
||||
});
|
||||
|
@ -83,7 +83,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.discover.clickFieldListPlusFilter(scriptedExpressionFieldName, '14');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
expect(await PageObjects.discover.getHitCount()).to.be('31');
|
||||
});
|
||||
});
|
||||
|
@ -119,7 +119,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
await log.debug('add scripted field');
|
||||
const script = 'doc[\'machine.ram\'].value / (1024 * 1024 * 1024)';
|
||||
await PageObjects.settings.addScriptedField(scriptedPainlessFieldName, 'painless', 'number', null, '1', script);
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount())).to.be(startingCount + 1);
|
||||
});
|
||||
});
|
||||
|
@ -133,12 +133,12 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await PageObjects.discover.clickFieldListItem(scriptedPainlessFieldName);
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
await PageObjects.discover.clickFieldListItemAdd(scriptedPainlessFieldName);
|
||||
});
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
const rowData = await PageObjects.discover.getDocTableIndex(1);
|
||||
expect(rowData).to.be('September 18th 2015, 18:20:57.916\n18');
|
||||
});
|
||||
|
@ -150,7 +150,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.discover.clickFieldListPlusFilter(scriptedPainlessFieldName, '14');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
expect(await PageObjects.discover.getHitCount()).to.be('31');
|
||||
});
|
||||
});
|
||||
|
@ -187,7 +187,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.settings
|
||||
.addScriptedField(scriptedPainlessFieldName2, 'painless', 'string', null, '1',
|
||||
'if (doc[\'response.raw\'].value == \'200\') { return \'good\'} else { return \'bad\'}');
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount())).to.be(startingCount + 1);
|
||||
});
|
||||
});
|
||||
|
@ -201,12 +201,12 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await PageObjects.discover.clickFieldListItem(scriptedPainlessFieldName2);
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
await PageObjects.discover.clickFieldListItemAdd(scriptedPainlessFieldName2);
|
||||
});
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
const rowData = await PageObjects.discover.getDocTableIndex(1);
|
||||
expect(rowData).to.be('September 18th 2015, 18:20:57.916\ngood');
|
||||
|
||||
|
@ -219,7 +219,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.discover.clickFieldListPlusFilter(scriptedPainlessFieldName2, 'bad');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
expect(await PageObjects.discover.getHitCount()).to.be('27');
|
||||
});
|
||||
await PageObjects.discover.removeAllFilters();
|
||||
|
@ -251,7 +251,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.settings
|
||||
.addScriptedField(scriptedPainlessFieldName2, 'painless', 'boolean', null, '1',
|
||||
'doc[\'response.raw\'].value == \'200\'');
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount())).to.be(startingCount + 1);
|
||||
});
|
||||
});
|
||||
|
@ -265,12 +265,12 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await PageObjects.discover.clickFieldListItem(scriptedPainlessFieldName2);
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
await PageObjects.discover.clickFieldListItemAdd(scriptedPainlessFieldName2);
|
||||
});
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
const rowData = await PageObjects.discover.getDocTableIndex(1);
|
||||
expect(rowData).to.be('September 18th 2015, 18:20:57.916\ntrue');
|
||||
|
||||
|
@ -283,7 +283,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.discover.clickFieldListPlusFilter(scriptedPainlessFieldName2, 'true');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
expect(await PageObjects.discover.getHitCount()).to.be('359');
|
||||
});
|
||||
await PageObjects.discover.removeAllFilters();
|
||||
|
@ -316,7 +316,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
.addScriptedField(scriptedPainlessFieldName2, 'painless', 'date',
|
||||
{ format: 'Date', datePattern: 'YYYY-MM-DD HH:00' }, '1',
|
||||
'doc[\'utc_time\'].value + (1000) * 60 * 60');
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount())).to.be(startingCount + 1);
|
||||
});
|
||||
});
|
||||
|
@ -330,12 +330,12 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await PageObjects.discover.clickFieldListItem(scriptedPainlessFieldName2);
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
await PageObjects.discover.clickFieldListItemAdd(scriptedPainlessFieldName2);
|
||||
});
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
const rowData = await PageObjects.discover.getDocTableIndex(1);
|
||||
expect(rowData).to.be('September 18th 2015, 06:52:55.953\n2015-09-18 07:00');
|
||||
});
|
||||
|
@ -347,7 +347,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.discover.clickFieldListPlusFilter(scriptedPainlessFieldName2, '2015-09-17 23:00');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
expect(await PageObjects.discover.getHitCount()).to.be('1');
|
||||
});
|
||||
await PageObjects.discover.removeAllFilters();
|
||||
|
|
|
@ -38,14 +38,14 @@ export default function ({ getService, getPageObjects }) {
|
|||
);
|
||||
|
||||
// confirm two additional scripted fields were created
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
const scriptedFieldLangs = await PageObjects.settings.getScriptedFieldLangs();
|
||||
expect(scriptedFieldLangs.length).to.be(scriptedFieldLangsBefore.length + 2);
|
||||
});
|
||||
|
||||
await PageObjects.settings.setScriptedFieldLanguageFilter('painless');
|
||||
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
const scriptedFieldLangs = await PageObjects.settings.getScriptedFieldLangs();
|
||||
expect(scriptedFieldLangs.length).to.be.above(0);
|
||||
for (const lang of scriptedFieldLangs) {
|
||||
|
@ -55,7 +55,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
await PageObjects.settings.setScriptedFieldLanguageFilter('expression');
|
||||
|
||||
await retry.try(async function() {
|
||||
await retry.try(async function () {
|
||||
const scriptedFieldLangs = await PageObjects.settings.getScriptedFieldLangs();
|
||||
expect(scriptedFieldLangs.length).to.be.above(0);
|
||||
for (const lang of scriptedFieldLangs) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue