diff --git a/.eslintrc.js b/.eslintrc.js index f4d869788ce9..1398b8f04d87 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -51,9 +51,6 @@ module.exports = { // make sure we're not leveraging any deprecated APIs 'deprecation/deprecation': 'error', - // TODO(#7338): Investigate enabling these soon ✨ - '@typescript-eslint/prefer-nullish-coalescing': 'off', - // TODO(#7130): Investigate changing these in or removing these from presets '@typescript-eslint/no-confusing-void-expression': 'off', '@typescript-eslint/prefer-string-starts-ends-with': 'off', @@ -109,6 +106,13 @@ module.exports = { 'error', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }, ], + '@typescript-eslint/prefer-nullish-coalescing': [ + 'error', + { + ignoreConditionalTests: true, + ignorePrimitives: true, + }, + ], // // Internal repo rules diff --git a/packages/eslint-plugin/src/rules/padding-line-between-statements.ts b/packages/eslint-plugin/src/rules/padding-line-between-statements.ts index 4359cd5d0876..563bc8e99ec9 100644 --- a/packages/eslint-plugin/src/rules/padding-line-between-statements.ts +++ b/packages/eslint-plugin/src/rules/padding-line-between-statements.ts @@ -476,7 +476,7 @@ function verifyForAlways( } return true; }, - }) || nextNode; + }) ?? nextNode; const insertText = isTokenOnSameLine(prevToken, nextToken) ? '\n\n' : '\n'; diff --git a/packages/eslint-plugin/src/rules/unified-signatures.ts b/packages/eslint-plugin/src/rules/unified-signatures.ts index 0d4b8e8035d3..9b5edbe0afba 100644 --- a/packages/eslint-plugin/src/rules/unified-signatures.ts +++ b/packages/eslint-plugin/src/rules/unified-signatures.ts @@ -369,7 +369,7 @@ export default createRule({ } return typeContainsTypeParameter( - (type as Partial).typeAnnotation || + (type as Partial).typeAnnotation ?? (type as TSESTree.TSArrayType).elementType, ); } @@ -523,7 +523,7 @@ export default createRule({ key ??= getOverloadKey(signature); if ( currentScope && - (containingNode || signature).parent === currentScope.parent + (containingNode ?? signature).parent === currentScope.parent ) { const overloads = currentScope.overloads.get(key); if (overloads !== undefined) { diff --git a/packages/rule-tester/src/utils/getRuleOptionsSchema.ts b/packages/rule-tester/src/utils/getRuleOptionsSchema.ts index 1ff81d658e8e..f00ff1de6c94 100644 --- a/packages/rule-tester/src/utils/getRuleOptionsSchema.ts +++ b/packages/rule-tester/src/utils/getRuleOptionsSchema.ts @@ -33,5 +33,5 @@ export function getRuleOptionsSchema( } // Given a full schema, leave it alone - return schema || null; + return schema ?? null; } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy