mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Co-authored-by: Spencer <email@spalger.com>
This commit is contained in:
parent
f8529850bb
commit
5345b4b68b
3 changed files with 34 additions and 11 deletions
|
@ -79,7 +79,7 @@ module.exports = {
|
|||
node.type === esTypes.FunctionExpression ||
|
||||
node.type === esTypes.ArrowFunctionExpression
|
||||
) {
|
||||
return traverse.STOP;
|
||||
return traverse.SKIP;
|
||||
}
|
||||
|
||||
if (
|
||||
|
|
|
@ -96,5 +96,25 @@ ruleTester.run('@kbn/eslint/no_constructor_args_in_property_initializers', rule,
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
code: dedent`
|
||||
class Foo {
|
||||
readonly bar = y(this.deps.history).x(
|
||||
() => {
|
||||
this.deps.usage()
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
constructor(private readonly deps: unknown) {}
|
||||
}
|
||||
`,
|
||||
errors: [
|
||||
{
|
||||
line: 2,
|
||||
message: `The constructor argument "deps" can't be used in a class property intializer, define the property in the constructor instead`,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
import { History } from 'history';
|
||||
import * as Rx from 'rxjs';
|
||||
import { filter } from 'rxjs/operators';
|
||||
import { DataPublicPluginStart } from '../../../../../../data/public';
|
||||
import {
|
||||
|
@ -29,17 +30,19 @@ export class DiscoverSearchSessionManager {
|
|||
* Notifies about `searchSessionId` changes in the URL,
|
||||
* skips if `searchSessionId` matches current search session id
|
||||
*/
|
||||
readonly newSearchSessionIdFromURL$ = createQueryParamObservable<string>(
|
||||
this.deps.history,
|
||||
SEARCH_SESSION_ID_QUERY_PARAM
|
||||
).pipe(
|
||||
filter((searchSessionId) => {
|
||||
if (!searchSessionId) return true;
|
||||
return !this.deps.session.isCurrentSession(searchSessionId);
|
||||
})
|
||||
);
|
||||
readonly newSearchSessionIdFromURL$: Rx.Observable<string | null>;
|
||||
|
||||
constructor(private readonly deps: DiscoverSearchSessionManagerDeps) {}
|
||||
constructor(private readonly deps: DiscoverSearchSessionManagerDeps) {
|
||||
this.newSearchSessionIdFromURL$ = createQueryParamObservable<string>(
|
||||
this.deps.history,
|
||||
SEARCH_SESSION_ID_QUERY_PARAM
|
||||
).pipe(
|
||||
filter((searchSessionId) => {
|
||||
if (!searchSessionId) return true;
|
||||
return !this.deps.session.isCurrentSession(searchSessionId);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get next session id by either starting or restoring a session.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue