Closed kulla closed 3 years ago
The refactoring tools of your editor / IDE of choice should already automate most of this (e.g. WebStorm, VS Code, not sure about others). So this issue is also a good way to get to know the refactoring tools or your editor / IDE.
Very interesting! Rename Symbol
in VSCode was quite nice, only stumbled on these constructions:
context({ req }): Promise<Pick<Context, 'service' | 'userId'>>
could you please check if that is the intended outcome or if it was to eager? 😄 https://github.com/serlo/api.serlo.org/pull/187
could you please check if that is the intended outcome or if it was to eager?
:+1: (It picks the service
and userId
property of the interface Context
👍 (It picks the service and userId property of the interface Context
sorry I don't understand what you mean here
sorry I don't understand what you mean here
I wanted to explain the Pick<A, B>
utility type: https://www.typescriptlang.org/docs/handbook/utility-types.html#picktype-keys
Ah, now I get it, thanks!
At https://github.com/serlo/api.serlo.org/blob/master/src/internals/graphql/context.ts#L25-L31 we defined our context. However since
user
isnumber | null
it would be better to rename it touserId
. Withyarn lint
you see which variables also need to be renamed.