Skip to content

Commit

Permalink
Fixes linting errors (#1115)
Browse files Browse the repository at this point in the history
Signed-off-by: Tommy Markley <[email protected]>
  • Loading branch information
Tommy Markley authored Jan 12, 2022
1 parent 86d13f8 commit 144eccd
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
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

0 comments on commit 144eccd

Please sign in to comment.