Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: enable prefer-nullish-coalescing internally#7955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions.eslintrc.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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',
Expand DownExpand Up@@ -109,6 +106,13 @@ module.exports = {
'error',
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
],
'@typescript-eslint/prefer-nullish-coalescing': [
'error',
{
ignoreConditionalTests: true,
ignorePrimitives: true,
},
],

//
// Internal repo rules
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -476,7 +476,7 @@ function verifyForAlways(
}
return true;
},
})|| nextNode;
})?? nextNode;
const insertText = isTokenOnSameLine(prevToken, nextToken)
? '\n\n'
: '\n';
Expand Down
4 changes: 2 additions & 2 deletionspackages/eslint-plugin/src/rules/unified-signatures.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -369,7 +369,7 @@ export default createRule<Options, MessageIds>({
}

return typeContainsTypeParameter(
(type as Partial<TSESTree.TSTypeAnnotation>).typeAnnotation||
(type as Partial<TSESTree.TSTypeAnnotation>).typeAnnotation??
(type as TSESTree.TSArrayType).elementType,
);
}
Expand DownExpand Up@@ -523,7 +523,7 @@ export default createRule<Options, MessageIds>({
key ??= getOverloadKey(signature);
if (
currentScope &&
(containingNode|| signature).parent === currentScope.parent
(containingNode?? signature).parent === currentScope.parent
) {
const overloads = currentScope.overloads.get(key);
if (overloads !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletionpackages/rule-tester/src/utils/getRuleOptionsSchema.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,5 +33,5 @@ export function getRuleOptionsSchema(
}

// Given a full schema, leave it alone
return schema|| null;
return schema?? null;
}

[8]ページ先頭

©2009-2025 Movatter.jp