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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rules from eslint's recommended set that triggered good lints #50422
Changes from 6 commits
572e6f4
cff4cff
77a2b74
6316ac8
ba00330
4650c81
3847091
d2d6c57
9a4f3e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5837,8 +5837,8 @@ namespace ts { | |
} | ||
|
||
function preserveCommentsOn<T extends Node>(node: T) { | ||
if (some(propertySymbol.declarations, d => d.kind === SyntaxKind.JSDocPropertyTag)) { | ||
const d = propertySymbol.declarations?.find(d => d.kind === SyntaxKind.JSDocPropertyTag)! as JSDocPropertyTag; | ||
const d = propertySymbol.declarations?.find(d => d.kind === SyntaxKind.JSDocPropertyTag) as JSDocPropertyTag | undefined; | ||
if (d) { | ||
const commentText = getTextOfJSDocComment(d.comment); | ||
if (commentText) { | ||
setSyntheticLeadingComments(node, [{ kind: SyntaxKind.MultiLineCommentTrivia, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); | ||
|
@@ -9198,7 +9198,7 @@ namespace ts { | |
if (container && (container.kind === SyntaxKind.Constructor || isJSConstructor(container))) { | ||
return container as ConstructorDeclaration; | ||
} | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❤️ semicolons |
||
} | ||
} | ||
|
||
/** Create a synthetic property access flow node after the last statement of the file */ | ||
|
@@ -29739,7 +29739,7 @@ namespace ts { | |
return !!s && getMinArgumentCount(s) >= 1 && isTypeAssignableTo(keyedType, getTypeAtPosition(s, 0)); | ||
} | ||
return false; | ||
}; | ||
} | ||
|
||
const suggestedMethod = isAssignmentTarget(expr) ? "set" : "get"; | ||
if (!hasProp(suggestedMethod)) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -359,7 +359,7 @@ namespace ts { | |
|
||
/* @internal */ | ||
export function computeLineStarts(text: string): number[] { | ||
const result: number[] = new Array(); | ||
const result: number[] = []; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe there was some reason for using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so. It's been there since the first commit of the TypeScript compiler. |
||
let pos = 0; | ||
let lineStart = 0; | ||
while (pos < text.length) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to set this; the default of "latest" is fine because we compile our source and any new syntax will be downleveled. No need to make eslint complain about it.