-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Type Parameter name TPublicMethod
must match one of the following formats: StrictPascalCase
#41
Comments
If this is intentional, I was under the impression that TSomething is the convention to name a local parameter, like |
I intentionally don't allow https://til.hashrocket.com/posts/cfnlyzxcrc-do-not-prefix-typescript-interface-names |
The article is about |
The same arguments apply though. You can see that the TS docs does not use the |
I don’t think that page helps your argument since it contains
as 2 of the 3 examples that use The main issue is that |
Before: function getMethod<
TType extends keyof MessengerMethods,
TMethod extends MessengerMethods[TType],
TPublicMethod extends PublicMethod<TMethod>
>(
type: TType,
options: { isNotification: true }
): SetReturnType<TPublicMethod, void>; After: function getMethod<
Type extends keyof MessengerMethods,
Method extends MessengerMethods[Type],
PublicMethodType extends PublicMethod<Method>
>(
type: Type,
options: { isNotification: true }
): SetReturnType<PublicMethodType, void>; Conflicts are rare in practice. |
If you want to look at what Microsoft does, check their libs, they all use single-letters: |
The first 2 are fine, so I'll try following it, but |
I generally use |
Personal opinion: in most cases with a conflict the naming isnt descriptive enough for a casual human reader to understand their differences. So in most cases the improved names are also easier to understand afterwards. If it is the special case of something TypeScript is able to differentiate between them and uses the "inner" specified one. But using a better name than just T as a prefix is also better here in my opinion. |
It seems that the config allows types named "TSomething":
eslint-config-xo-typescript/index.js
Line 331 in 7c1e7d2
but I'm getting this error:
See run https://github.com/pixiebrix/webext-messenger/actions/runs/1300974580 for pixiebrix/webext-messenger#35.
The text was updated successfully, but these errors were encountered: