Skip to content

Commit 0d1c719

Browse files
committed
Disallow null
1 parent e7b936c commit 0d1c719

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

index.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,10 @@ module.exports = {
7979
fixWith: 'Record<string, unknown>'
8080
},
8181
Function: 'Use a specific function type instead, like `() => void`.',
82-
83-
// TODO: Try to enable this in 2021.
84-
// null: {
85-
// message: 'Use `undefined` instead. See: https://github.com/sindresorhus/meta/issues/7',
86-
// fixWith: 'undefined'
87-
// }
88-
82+
null: {
83+
message: 'Use `undefined` instead. See: https://github.com/sindresorhus/meta/issues/7',
84+
fixWith: 'undefined'
85+
},
8986
'[]': 'Don\'t use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.',
9087
'[[]]': 'Don\'t use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.',
9188
'[[[]]]': 'Don\'t use `[[[]]]`. Use `SomeType[][][]` instead.',
@@ -132,7 +129,7 @@ module.exports = {
132129
}
133130
],
134131

135-
// This rule is fine. I just don't want to deal with the churn yet. Enable this in 2022.
132+
// This rule is fine. I just don't want to deal with the churn yet. Enable this in 2023.
136133
// '@typescript-eslint/consistent-type-definitions': [
137134
// 'error',
138135
// 'type'
@@ -268,7 +265,7 @@ module.exports = {
268265
],
269266

270267
// Disabled for now as it causes too many weird TypeScript issues. I'm not sure whether the problems are caused by bugs in TS or problems in my types.
271-
// TODO: Try to re-enable this again in 2022.
268+
// TODO: Try to re-enable this again in 2023.
272269
// '@typescript-eslint/method-signature-style': 'error',
273270

274271
// We use `@typescript-eslint/naming-convention` in favor of `camelcase`.
@@ -365,7 +362,7 @@ module.exports = {
365362
}
366363
],
367364

368-
// TODO: Try to enable this again in 2022.
365+
// TODO: Try to enable this again in 2023.
369366
// Disabled for now. This is a great rule. It's just that TypeScript is not good enough yet to not use `any` in many places.
370367
// For example: https://github.com/sindresorhus/refined-github/pull/2391#discussion_r318995182
371368
// '@typescript-eslint/no-explicit-any': [
@@ -484,7 +481,6 @@ module.exports = {
484481
'no-constant-condition': 'error',
485482

486483
// TODO: Try to enable this again in 2023 *if* the following are resolved:
487-
// - https://github.com/microsoft/TypeScript/issues/13778 (otherwise, it will report on if checks for elements extracted from array)
488484
// - https://github.com/microsoft/TypeScript/issues/36393
489485
// - The rule needs a way to ignore runtime type-checks: https://github.com/sindresorhus/refined-github/pull/3168
490486
// - Run the rule on https://github.com/sindresorhus/refined-github and ensure there are no false-positives
@@ -612,7 +608,7 @@ module.exports = {
612608
'always'
613609
],
614610

615-
// TODO: Reconsider enabling it again in 2021.
611+
// TODO: Reconsider enabling it again in 2023.
616612
// NOTE: The rule was complete redone in typescript-eslint v3, so this config needs to be changed before this is enabled.
617613
// Disabled for now as it's too strict.
618614
// Relevant discussion: https://github.com/sindresorhus/refined-github/pull/2521#discussion_r343013852
@@ -654,6 +650,9 @@ module.exports = {
654650
// TypeScript might have features not supported in a specific Node.js version.
655651
'node/no-unsupported-features/es-syntax': 'off',
656652
'node/no-unsupported-features/es-builtins': 'off',
653+
654+
// We use `@typescript-eslint/ban-types` instead.
655+
'unicorn/no-null': 'off'
657656
},
658657
overrides: [
659658
{

0 commit comments

Comments
 (0)