Skip to content

Commit 3144186

Browse files
committed
feat: add ban-types rule
This was present in the old tslint config
1 parent 0091e6e commit 3144186

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.eslintrc.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,26 @@ module.exports = {
161161
'@typescript-eslint/adjacent-overload-signatures': 'error',
162162
'@typescript-eslint/array-type': 'error',
163163
'@typescript-eslint/await-thenable': 'error',
164-
'@typescript-eslint/ban-types': 'error',
164+
'@typescript-eslint/ban-types': [
165+
'error',
166+
{
167+
types: {
168+
Function: 'Use a concrete function type like () => T instead',
169+
String: {
170+
message: 'Use string (lowercase) instead',
171+
fixWith: 'string',
172+
},
173+
Boolean: {
174+
message: 'Use boolean (lowercase) instead',
175+
fixWith: 'boolean',
176+
},
177+
Number: {
178+
message: 'Use number (lowercase) instead',
179+
fixWith: 'number',
180+
},
181+
},
182+
},
183+
],
165184
'@typescript-eslint/camelcase': 'off',
166185
'@typescript-eslint/class-name-casing': 'error',
167186
'@typescript-eslint/explicit-function-return-type': [

0 commit comments

Comments
 (0)