Skip to content

Commit 77f693f

Browse files
committed
Allow either T or a longer generic type name
Use `T` for simple expressions, and a longer name for complicated expressions or when you need multiple generic names.
1 parent fcc76f1 commit 77f693f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ module.exports = {
5050
},
5151
object: 'Use `{}` instead.',
5252
Function: 'Use a specific function type instead, like `() => void`.',
53+
54+
// This one doesn't seem to be working.
55+
// TODO: Report it.
5356
any: {
5457
message: 'Use `unknown` instead.',
5558
fixWith: 'unknown'
@@ -75,7 +78,7 @@ module.exports = {
7578
],
7679
'@typescript-eslint/generic-type-naming': [
7780
'error',
78-
'^[A-Z][a-zA-Z]+$'
81+
'^T$|^[A-Z][a-zA-Z]+$'
7982
],
8083
indent: 'off',
8184
'@typescript-eslint/indent': [

0 commit comments

Comments
 (0)