Skip to content

Commit 599e3de

Browse files
committed
Add more cases to ban-types
1 parent 17cdfdf commit 599e3de

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ module.exports = {
7979
// fixWith: 'undefined'
8080
// }
8181

82+
'[]': 'Don\'t use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.',
83+
'[[]]': 'Don\'t use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.',
84+
'[[[]]]': 'Don\'t use `[[[]]]`. Use `SomeType[][][]` instead.',
85+
'[[[[]]]]': 'ur drunk 🤡',
86+
'[[[[[]]]]]': '🦄💥',
8287
Omit: 'Prefer the `Except` type in the `type-fest` package instead as it\'s stricter.'
8388
}
8489
}
@@ -429,7 +434,8 @@ module.exports = {
429434
// '@typescript-eslint/prefer-readonly-parameter-types': [
430435
// 'error',
431436
// {
432-
// checkParameterProperties: true
437+
// checkParameterProperties: true,
438+
// ignoreInferredTypes: true
433439
// }
434440
// ],
435441

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@
4444
"simple"
4545
],
4646
"devDependencies": {
47-
"@typescript-eslint/eslint-plugin": "^4.4.0",
48-
"@typescript-eslint/parser": "^4.4.0",
47+
"@typescript-eslint/eslint-plugin": "^4.6.0",
48+
"@typescript-eslint/parser": "^4.6.0",
4949
"ava": "^2.4.0",
5050
"eslint": "^7.8.1",
5151
"temp-write": "^4.0.0",
5252
"typescript": "^4.0.2"
5353
},
5454
"peerDependencies": {
55-
"@typescript-eslint/eslint-plugin": ">=4.4.0",
55+
"@typescript-eslint/eslint-plugin": ">=4.6.0",
5656
"eslint": ">=7.8.0",
5757
"typescript": ">=3.6.0"
5858
}

0 commit comments

Comments
 (0)