Skip to content

fix(schema): Allow regular functions in resolvers#3487

Merged
daffl merged 1 commit intofeathersjs:dovefrom
avorra:resolver-types-regfunc
May 29, 2024
Merged

fix(schema): Allow regular functions in resolvers#3487
daffl merged 1 commit intofeathersjs:dovefrom
avorra:resolver-types-regfunc

Conversation

@ramijarrar
Copy link
Contributor

@ramijarrar ramijarrar commented May 15, 2024

Alters the expected return type of property resolvers and converters from Promise<T> to Promise<T> | T.

This ensures users are not forced to unnecessarily provide async functions with no await expression, which is often considered bad practice and disallowed by linting rules.

Alters the expected return type of property resolvers and converters from "Promise<T>" to "Promise<T> | T".

This ensures users are not forced to unnecessarily provide async functions with no await expression, which is considered bad practice and often disallowed by linting rules (see typescript-eslint/typescript-eslint#7536 (comment)).
Copy link
Member

@marshallswain marshallswain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@daffl daffl changed the title feat(schema): allow regular functions in resolvers fix(schema): allow regular functions in resolvers May 29, 2024
@daffl daffl changed the title fix(schema): allow regular functions in resolvers fix(schema): Allow regular functions in resolvers May 29, 2024
@daffl daffl merged commit 187868e into feathersjs:dove May 29, 2024
@daffl
Copy link
Member

daffl commented May 29, 2024

This is a really good change. Will go out with the next release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants