-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[no-type-alias] Readonly<[A, B]>
should be allowed same as readonly [A, B]
by allowTupleTypes
#3181
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
Comments
I think we can add a new option |
Actually I just want to disable codes like |
@bradzacher Hi, do you have any idea to help? I'd like to work on it if there is a good option/way to handle |
in |
@bradzacher I mean disallow |
there is no mechanism to disable just type reference aliases. All of the options and what they apply to are listed in the docs You could likely build a selector to match this and block it via no-restricted-syntax - https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#how-can-i-ban-specific-language-feature |
Thanks, I'll give that a try. |
@bradzacher Thanks a lot, I finished up by: {
'no-restricted-syntax': [
2,
{
selector:
'TSTypeAliasDeclaration > .typeAnnotation[type=/^(TS.*Keyword|TSTypeReference)$/]:not(:has(TSTypeParameterInstantiation)):not(:has(TSQualifiedName))',
message:
'Type alias references simple `Ts*Keyword`s or `TSTypeReference` only is not allowed',
},
],
} Is it worth to add into |
This can now be allowed broadly via the option added in #3865 |
Repro
Expected Result
No error
Actual Result
not allowed
Additional Info
Versions
@typescript-eslint/eslint-plugin
4.17.0
@typescript-eslint/parser
4.17.0
TypeScript
4.2.3
ESLint
7.21.0
node
14.16.0
The text was updated successfully, but these errors were encountered: