mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Upgrade prettier to version 1.14.0 (#21466)
This upgrades prettier to version 1.14.0. The main motivation is to gain support for the new TypeScript language features introduced in 2.9 and 3.0. Prettier versions 1.13 and 1.14 also introduced some other JavaScript and TypeScript style improvements resulting in a few small line break and parenthesis changes. The relevant release notes are: * [Prettier 1.13.0 Release Notes](https://prettier.io/blog/2018/05/27/1.13.0.html) * [Prettier 1.40.0 Release Notes](https://prettier.io/blog/2018/07/29/1.14.0.html)
This commit is contained in:
parent
149ff8ed17
commit
1211efdf40
30 changed files with 126 additions and 51 deletions
|
@ -333,7 +333,7 @@
|
|||
"nock": "8.0.0",
|
||||
"node-sass": "^4.9.0",
|
||||
"pixelmatch": "4.0.2",
|
||||
"prettier": "^1.12.1",
|
||||
"prettier": "^1.14.0",
|
||||
"proxyquire": "1.7.11",
|
||||
"simple-git": "1.37.0",
|
||||
"sinon": "^5.0.7",
|
||||
|
|
|
@ -30,8 +30,14 @@ import { first, ignoreElements, map } from 'rxjs/operators';
|
|||
*/
|
||||
export function observeReadable(readable) {
|
||||
return Rx.race(
|
||||
Rx.fromEvent(readable, 'end').pipe(first(), ignoreElements()),
|
||||
Rx.fromEvent(readable, 'end').pipe(
|
||||
first(),
|
||||
ignoreElements()
|
||||
),
|
||||
|
||||
Rx.fromEvent(readable, 'error').pipe(first(), map(err => Rx.throwError(err)))
|
||||
Rx.fromEvent(readable, 'error').pipe(
|
||||
first(),
|
||||
map(err => Rx.throwError(err))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -27,8 +27,7 @@ const tarFs = require('tar-fs');
|
|||
|
||||
function decompressTarball(archive, dirPath) {
|
||||
return new Promise((resolve, reject) => {
|
||||
fs
|
||||
.createReadStream(archive)
|
||||
fs.createReadStream(archive)
|
||||
.on('error', reject)
|
||||
.pipe(zlib.createGunzip())
|
||||
.on('error', reject)
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
"log-symbols": "^2.2.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"ora": "^1.4.0",
|
||||
"prettier": "^1.12.1",
|
||||
"prettier": "^1.14.0",
|
||||
"read-pkg": "^3.0.0",
|
||||
"rxjs": "^6.2.1",
|
||||
"spawn-sync": "^1.0.15",
|
||||
|
|
|
@ -58,18 +58,31 @@ function getWatchHandlers(
|
|||
const typescriptHandler = buildOutput$.pipe(
|
||||
first(data => data.includes('$ tsc')),
|
||||
map(() =>
|
||||
buildOutput$.pipe(first(data => data.includes('Compilation complete.')), mapTo('tsc'))
|
||||
buildOutput$.pipe(
|
||||
first(data => data.includes('Compilation complete.')),
|
||||
mapTo('tsc')
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
const webpackHandler = buildOutput$.pipe(
|
||||
first(data => data.includes('$ webpack')),
|
||||
map(() => buildOutput$.pipe(first(data => data.includes('Chunk Names')), mapTo('webpack')))
|
||||
map(() =>
|
||||
buildOutput$.pipe(
|
||||
first(data => data.includes('Chunk Names')),
|
||||
mapTo('webpack')
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
const defaultHandler = Rx.of(undefined).pipe(
|
||||
delay(handlerReadinessTimeout),
|
||||
map(() => buildOutput$.pipe(timeout(handlerDelay), catchError(() => Rx.of('timeout'))))
|
||||
map(() =>
|
||||
buildOutput$.pipe(
|
||||
timeout(handlerDelay),
|
||||
catchError(() => Rx.of('timeout'))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
return [typescriptHandler, webpackHandler, defaultHandler];
|
||||
|
|
|
@ -2909,9 +2909,9 @@ preserve@^0.2.0:
|
|||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
|
||||
|
||||
prettier@^1.12.1:
|
||||
version "1.12.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.1.tgz#c1ad20e803e7749faf905a409d2367e06bbe7325"
|
||||
prettier@^1.14.0:
|
||||
version "1.14.0"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.0.tgz#847c235522035fd988100f1f43cf20a7d24f9372"
|
||||
|
||||
private@^0.1.6, private@^0.1.7:
|
||||
version "0.1.8"
|
||||
|
|
|
@ -92,7 +92,11 @@ export async function startServers(options) {
|
|||
|
||||
async function silence(milliseconds, { log }) {
|
||||
await Rx.fromEvent(log, 'data')
|
||||
.pipe(startWith(null), switchMap(() => Rx.timer(milliseconds)), take(1))
|
||||
.pipe(
|
||||
startWith(null),
|
||||
switchMap(() => Rx.timer(milliseconds)),
|
||||
take(1)
|
||||
)
|
||||
.toPromise();
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,10 @@ export function reduce<T, R>(
|
|||
initialValue: R
|
||||
): OperatorFunction<T, R> {
|
||||
return function reduceOperation(source) {
|
||||
return pipe(scan(accumulator, initialValue), ifEmpty(() => initialValue), last())(source);
|
||||
return pipe(
|
||||
scan(accumulator, initialValue),
|
||||
ifEmpty(() => initialValue),
|
||||
last()
|
||||
)(source);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -17,4 +17,7 @@ function mapStateToProps(state = {}) {
|
|||
|
||||
const mapDispatchToProps = {};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(ErrorGroupDetails);
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ErrorGroupDetails);
|
||||
|
|
|
@ -251,7 +251,8 @@ export default class WatcherFlyout extends Component {
|
|||
href={_.get(ELASTIC_DOCS, 'watcher-get-started.url')}
|
||||
>
|
||||
documentation
|
||||
</EuiLink>.
|
||||
</EuiLink>
|
||||
.
|
||||
</p>
|
||||
|
||||
<EuiForm>
|
||||
|
@ -368,7 +369,8 @@ export default class WatcherFlyout extends Component {
|
|||
href={_.get(ELASTIC_DOCS, 'x-pack-emails.url')}
|
||||
>
|
||||
documentation
|
||||
</EuiLink>.
|
||||
</EuiLink>
|
||||
.
|
||||
</span>
|
||||
}
|
||||
>
|
||||
|
@ -399,7 +401,8 @@ export default class WatcherFlyout extends Component {
|
|||
href="https://get.slack.help/hc/en-us/articles/115005265063-Incoming-WebHooks-for-Slack"
|
||||
>
|
||||
documentation
|
||||
</EuiLink>.
|
||||
</EuiLink>
|
||||
.
|
||||
</span>
|
||||
}
|
||||
>
|
||||
|
|
|
@ -19,4 +19,7 @@ function mapStateToProps(state = {}) {
|
|||
|
||||
const mapDispatchToProps = {};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(ErrorGroupOverview);
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ErrorGroupOverview);
|
||||
|
|
|
@ -26,7 +26,9 @@ export default function Main() {
|
|||
{routes.map((route, i) => {
|
||||
return route.switch ? (
|
||||
<Switch key={i}>
|
||||
{route.routes.map((route, i) => <Route key={i} {...route} />)}
|
||||
{route.routes.map((route, i) => (
|
||||
<Route key={i} {...route} />
|
||||
))}
|
||||
</Switch>
|
||||
) : (
|
||||
<Route key={i} {...route} />
|
||||
|
|
|
@ -17,4 +17,7 @@ function mapStateToProps(state = {}) {
|
|||
}
|
||||
|
||||
const mapDispatchToProps = {};
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(ServiceOverview);
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ServiceOverview);
|
||||
|
|
|
@ -29,7 +29,8 @@ const SamplingTooltip = () => (
|
|||
<Tooltip>
|
||||
<TooltipTitle>Sampling</TooltipTitle>
|
||||
Each bucket will show a sample transaction. If there's no sample
|
||||
available,<br />
|
||||
available,
|
||||
<br />
|
||||
it's most likely because of the sampling limit set in the agent
|
||||
configuration.
|
||||
</Tooltip>
|
||||
|
|
|
@ -16,4 +16,7 @@ function mapStateToProps(state = {}) {
|
|||
}
|
||||
|
||||
const mapDispatchToProps = {};
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Distribution);
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(Distribution);
|
||||
|
|
|
@ -104,8 +104,8 @@ class Span extends React.Component {
|
|||
location
|
||||
} = this.props;
|
||||
|
||||
const width = get({ span }, SPAN_DURATION) / totalDuration * 100;
|
||||
const left = get({ span }, SPAN_START) / totalDuration * 100;
|
||||
const width = (get({ span }, SPAN_DURATION) / totalDuration) * 100;
|
||||
const left = (get({ span }, SPAN_START) / totalDuration) * 100;
|
||||
|
||||
const spanId = get({ span }, SPAN_ID);
|
||||
const spanName = get({ span }, SPAN_NAME);
|
||||
|
@ -132,7 +132,9 @@ class Span extends React.Component {
|
|||
}}
|
||||
/>
|
||||
<SpanLabel style={{ left: `${left}%`, width: `${100 - left}%` }}>
|
||||
‎{spanName}‎
|
||||
‎
|
||||
{spanName}
|
||||
‎
|
||||
</SpanLabel>
|
||||
|
||||
<Modal
|
||||
|
|
|
@ -16,4 +16,7 @@ function mapStateToProps(state = {}) {
|
|||
}
|
||||
|
||||
const mapDispatchToProps = {};
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Spans);
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(Spans);
|
||||
|
|
|
@ -14,4 +14,7 @@ function mapStateToProps(state = {}) {
|
|||
}
|
||||
|
||||
const mapDispatchToProps = {};
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Transaction);
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(Transaction);
|
||||
|
|
|
@ -67,7 +67,7 @@ const DEFAULT_TAB = 'timeline';
|
|||
|
||||
export function getAgentMarks(transaction) {
|
||||
const duration = get(transaction, TRANSACTION_DURATION);
|
||||
const threshold = duration / 100 * 2;
|
||||
const threshold = (duration / 100) * 2;
|
||||
|
||||
return sortBy(
|
||||
Object.entries(get(transaction, 'transaction.marks.agent', [])),
|
||||
|
|
|
@ -16,6 +16,7 @@ function mapStateToProps(state = {}) {
|
|||
}
|
||||
|
||||
const mapDispatchToProps = {};
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(
|
||||
TransactionsDetails
|
||||
);
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(TransactionsDetails);
|
||||
|
|
|
@ -68,7 +68,8 @@ export default class DynamicBaselineFlyout extends Component {
|
|||
text: (
|
||||
<p>
|
||||
There's already a job running for anomaly detection on{' '}
|
||||
{serviceName} ({transactionType}).{' '}
|
||||
{serviceName} ({transactionType}
|
||||
).{' '}
|
||||
<a href={getMlJobUrl(serviceName, transactionType, location)}>
|
||||
View existing job
|
||||
</a>
|
||||
|
@ -89,8 +90,8 @@ export default class DynamicBaselineFlyout extends Component {
|
|||
color: 'success',
|
||||
text: (
|
||||
<p>
|
||||
The analysis is now running for {serviceName} ({transactionType}).
|
||||
It might take a while before results are added to the response
|
||||
The analysis is now running for {serviceName} ({transactionType}
|
||||
). It might take a while before results are added to the response
|
||||
times graph.{' '}
|
||||
<a href={getMlJobUrl(serviceName, transactionType, location)}>
|
||||
View job
|
||||
|
@ -140,9 +141,9 @@ export default class DynamicBaselineFlyout extends Component {
|
|||
iconType="check"
|
||||
>
|
||||
<p>
|
||||
There is currently a job running for {serviceName} ({
|
||||
transactionType
|
||||
}).{' '}
|
||||
There is currently a job running for {serviceName} (
|
||||
{transactionType}
|
||||
).{' '}
|
||||
<a href={getMlJobUrl(serviceName, transactionType, location)}>
|
||||
View existing job
|
||||
</a>
|
||||
|
|
|
@ -22,7 +22,9 @@ const ImpactTooltip = () => (
|
|||
trigger="hover"
|
||||
overlay={
|
||||
<Tooltip>
|
||||
Impact shows the most used and<br />slowest endpoints in your service.
|
||||
Impact shows the most used and
|
||||
<br />
|
||||
slowest endpoints in your service.
|
||||
</Tooltip>
|
||||
}
|
||||
>
|
||||
|
|
|
@ -21,6 +21,7 @@ function mapStateToProps(state = {}) {
|
|||
|
||||
const mapDispatchToProps = {};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(
|
||||
TransactionOverview
|
||||
);
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(TransactionOverview);
|
||||
|
|
|
@ -11,4 +11,7 @@ import { updateLocation } from '../../../store/location';
|
|||
const mapDispatchToProps = {
|
||||
updateLocation
|
||||
};
|
||||
export default connect(null, mapDispatchToProps)(view);
|
||||
export default connect(
|
||||
null,
|
||||
mapDispatchToProps
|
||||
)(view);
|
||||
|
|
|
@ -17,4 +17,7 @@ function mapStateToProps(state = {}) {
|
|||
}
|
||||
|
||||
const mapDispatchToProps = {};
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(TabNavigation);
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(TabNavigation);
|
||||
|
|
|
@ -80,7 +80,8 @@ function TabNavigation({ urlParams, location }) {
|
|||
<TooltipOverlay
|
||||
content={
|
||||
<span>
|
||||
Transaction type:<br />
|
||||
Transaction type:
|
||||
<br />
|
||||
{label}
|
||||
</span>
|
||||
}
|
||||
|
|
|
@ -57,7 +57,12 @@ function MoreSeries({ hiddenSeriesCount }) {
|
|||
return null;
|
||||
}
|
||||
|
||||
return <MoreSeriesContainer>(+{hiddenSeriesCount})</MoreSeriesContainer>;
|
||||
return (
|
||||
<MoreSeriesContainer>
|
||||
(+
|
||||
{hiddenSeriesCount})
|
||||
</MoreSeriesContainer>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Legends({
|
||||
|
|
|
@ -15,7 +15,10 @@ const INITIAL_DATA = [];
|
|||
const withInitialData = createInitialDataSelector(INITIAL_DATA);
|
||||
|
||||
const getRelativeImpact = (impact, impactMin, impactMax) =>
|
||||
Math.max((impact - impactMin) / Math.max(impactMax - impactMin, 1) * 100, 1);
|
||||
Math.max(
|
||||
((impact - impactMin) / Math.max(impactMax - impactMin, 1)) * 100,
|
||||
1
|
||||
);
|
||||
|
||||
function getWithRelativeImpact(items) {
|
||||
const impacts = items.map(({ impact }) => impact);
|
||||
|
|
|
@ -125,7 +125,10 @@ export function KibanaLinkComponent({
|
|||
return <EuiLink {...props} href={href} />;
|
||||
}
|
||||
|
||||
const withLocation = connect(({ location }) => ({ location }), {});
|
||||
const withLocation = connect(
|
||||
({ location }) => ({ location }),
|
||||
{}
|
||||
);
|
||||
export const RelativeLink = withLocation(RelativeLinkComponent);
|
||||
export const KibanaLink = withLocation(KibanaLinkComponent);
|
||||
|
||||
|
|
|
@ -10397,9 +10397,9 @@ preserve@^0.2.0:
|
|||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
|
||||
|
||||
prettier@^1.12.1:
|
||||
version "1.12.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.1.tgz#c1ad20e803e7749faf905a409d2367e06bbe7325"
|
||||
prettier@^1.14.0:
|
||||
version "1.14.0"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.0.tgz#847c235522035fd988100f1f43cf20a7d24f9372"
|
||||
|
||||
pretty-format@^22.4.3:
|
||||
version "22.4.3"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue