-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:elastic/kibana into feat/osquery-…
…packs
- Loading branch information
Showing
220 changed files
with
4,368 additions
and
1,522 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const { TestFailures } = require('kibana-buildkite-library'); | ||
|
||
(async () => { | ||
try { | ||
await TestFailures.annotateTestFailures(); | ||
} catch (ex) { | ||
console.error('Annotate test failures error', ex.message); | ||
if (ex.response) { | ||
console.error('HTTP Error Response Status', ex.response.status); | ||
console.error('HTTP Error Response Body', ex.response.data); | ||
} | ||
process.exit(1); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/kbn-eslint-plugin-eslint/rules/no_trailing_import_slash.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
/** @typedef {import("eslint").Rule.RuleModule} Rule */ | ||
/** @typedef {import("@typescript-eslint/typescript-estree").TSESTree.ImportDeclaration} ImportDeclaration */ | ||
|
||
const ERROR_MSG = | ||
'Using a trailing slash in package import statements causes issues with webpack and is inconsistent with the rest of the respository.'; | ||
|
||
/** @type {Rule} */ | ||
module.exports = { | ||
meta: { | ||
fixable: 'code', | ||
schema: [], | ||
}, | ||
create: (context) => ({ | ||
ImportDeclaration(_) { | ||
const node = /** @type {ImportDeclaration} */ (_); | ||
const req = node.source.value; | ||
|
||
if (!req.startsWith('.') && req.endsWith('/')) { | ||
context.report({ | ||
message: ERROR_MSG, | ||
loc: node.source.loc, | ||
fix(fixer) { | ||
return fixer.replaceText(node.source, `'${req.slice(0, -1)}'`); | ||
}, | ||
}); | ||
} | ||
}, | ||
}), | ||
}; |
75 changes: 75 additions & 0 deletions
75
packages/kbn-eslint-plugin-eslint/rules/no_trailing_import_slash.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
const { RuleTester } = require('eslint'); | ||
const rule = require('./no_trailing_import_slash'); | ||
const dedent = require('dedent'); | ||
|
||
const ruleTester = new RuleTester({ | ||
parser: require.resolve('@typescript-eslint/parser'), | ||
parserOptions: { | ||
sourceType: 'module', | ||
ecmaVersion: 2018, | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
}); | ||
|
||
ruleTester.run('@kbn/eslint/no_trailing_import_slash', rule, { | ||
valid: [ | ||
{ | ||
code: dedent` | ||
import foo from 'bar'; | ||
`, | ||
}, | ||
{ | ||
code: dedent` | ||
import foo from './bar'; | ||
`, | ||
}, | ||
{ | ||
code: dedent` | ||
import foo from './bar/'; | ||
`, | ||
}, | ||
], | ||
|
||
invalid: [ | ||
{ | ||
code: dedent` | ||
import foo from 'bar/'; | ||
`, | ||
errors: [ | ||
{ | ||
line: 1, | ||
message: | ||
'Using a trailing slash in package import statements causes issues with webpack and is inconsistent with the rest of the respository.', | ||
}, | ||
], | ||
output: dedent` | ||
import foo from 'bar'; | ||
`, | ||
}, | ||
{ | ||
code: dedent` | ||
import foo from 'bar/box/'; | ||
`, | ||
errors: [ | ||
{ | ||
line: 1, | ||
message: | ||
'Using a trailing slash in package import statements causes issues with webpack and is inconsistent with the rest of the respository.', | ||
}, | ||
], | ||
output: dedent` | ||
import foo from 'bar/box'; | ||
`, | ||
}, | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.