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

Fixes linting errors #1115

Merged
merged 1 commit into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/osd-config-schema/src/types/object_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ type RequiredProperties<Base extends Props> = Pick<
// this might not have perfect _rendering_ output, but it will be typed.
export type ObjectResultType<P extends Props> = Readonly<
{ [K in keyof OptionalProperties<P>]?: TypeOf<P[K]> } &
{ [K in keyof RequiredProperties<P>]: TypeOf<P[K]> }
{
[K in keyof RequiredProperties<P>]: TypeOf<P[K]>;
}
>;

type DefinedProperties<Base extends NullableProps> = Pick<
Expand All @@ -70,7 +72,9 @@ type DefinedProperties<Base extends NullableProps> = Pick<
>;

type ExtendedProps<P extends Props, NP extends NullableProps> = Omit<P, keyof NP> &
{ [K in keyof DefinedProperties<NP>]: NP[K] };
{
[K in keyof DefinedProperties<NP>]: NP[K];
};

type ExtendedObjectType<P extends Props, NP extends NullableProps> = ObjectType<
ExtendedProps<P, NP>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ const ExitFullScreenButton = () => <div data-test-subj="exitFullScreenModeText">

function getProps(
props?: Partial<DashboardViewportProps>
): { props: DashboardViewportProps; options: DashboardContainerOptions } {
): {
props: DashboardViewportProps;
options: DashboardContainerOptions;
} {
const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
CONTACT_CARD_EMBEDDABLE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,7 @@ export interface TutorialContext {
export type TutorialProvider = (context: TutorialContext) => TutorialSchema;
export type TutorialContextFactory = (
req: OpenSearchDashboardsRequest
) => { [key: string]: unknown };
) => {
[key: string]: unknown;
};
export type ScopedTutorialContextFactory = (...args: any[]) => any;
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ describe('StepIndexPattern', () => {
// Ensure it works in the other code flow too (the other early return)

// Provide `opensearch` so we do not auto append * and enter our other code flow
instance.onQueryChanged({ target: { value: 'opensearch' } } as React.ChangeEvent<
HTMLInputElement
>);
instance.onQueryChanged({
target: { value: 'opensearch' },
} as React.ChangeEvent<HTMLInputElement>);
instance.lastQuery = 'o';
await new Promise((resolve) => process.nextTick(resolve));
expect(component.state('exactMatchedIndices')).toEqual([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ describe('Saved Object', () => {

return createInitializedSavedObject({ type: 'dashboard', id: 'myId' }).then(
(savedObject) => {
stubSavedObjectsClientCreate({ id: 'myId' } as SimpleSavedObject<
SavedObjectAttributes
>);
stubSavedObjectsClientCreate({
id: 'myId',
} as SimpleSavedObject<SavedObjectAttributes>);

return savedObject.save({ confirmOverwrite: false }).then(() => {
expect(startMock.overlays.openModal).not.toHaveBeenCalled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ describe('NumberRow', () => {

test('should call onChange', () => {
const comp = shallow(<NumberRow {...defaultProps} />);
comp.find('EuiFieldNumber').prop('onChange')!({ target: { value: '5' } } as React.ChangeEvent<
HTMLInputElement
>);
comp.find('EuiFieldNumber').prop('onChange')!({
target: { value: '5' },
} as React.ChangeEvent<HTMLInputElement>);

expect(defaultProps.onChange).lastCalledWith({ id: defaultProps.model.id, value: '5' });
});
Expand Down