-
Notifications
You must be signed in to change notification settings - Fork 204
Enable the @typescript-eslint/restrict-template-expressions rule #4111
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
Changes from all commits
3511e8a
527519d
b305a21
24626c8
25ba228
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 | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -80,11 +80,11 @@ class AstViewerDataProvider | |||||||
const treeItem = new TreeItem(item.label || "", state); | ||||||||
treeItem.description = line ? `Line ${line}` : ""; | ||||||||
treeItem.id = String(item.id); | ||||||||
treeItem.tooltip = `${treeItem.description} ${treeItem.label}`; | ||||||||
treeItem.tooltip = `${treeItem.description} ${typeof treeItem.label === "string" ? treeItem.label : (treeItem.label?.label ?? "")}`; | ||||||||
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. [nitpick] This line is extremely long and hard to read. Consider extracting the label logic into a variable:
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback 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. This is a bit ugly but the type of |
||||||||
treeItem.command = { | ||||||||
command: "codeQLAstViewer.gotoCode", | ||||||||
title: "Go To Code", | ||||||||
tooltip: `Go To ${item.location}`, | ||||||||
tooltip: "Go To Code", | ||||||||
arguments: [item], | ||||||||
}; | ||||||||
return treeItem; | ||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -99,7 +99,7 @@ async function previewQueryHelp( | |||||
telemetryListener, | ||||||
errorMessage, | ||||||
{ | ||||||
fullMessage: `${errorMessage}\n${getErrorMessage(e)}`, | ||||||
fullMessage: `${errorMessage.fullMessage}\n${getErrorMessage(e)}`, | ||||||
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. The variable
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
}, | ||||||
); | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -45,7 +45,10 @@ class EvalLogDataProvider | |||||
? TreeItemCollapsibleState.Collapsed | ||||||
: TreeItemCollapsibleState.None; | ||||||
const treeItem = new TreeItem(element.label || "", state); | ||||||
treeItem.tooltip = `${treeItem.label} || ''}`; | ||||||
treeItem.tooltip = | ||||||
typeof treeItem.label === "string" | ||||||
? treeItem.label | ||||||
: (treeItem.label?.label ?? ""); | ||||||
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. The original line 47 uses
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
return treeItem; | ||||||
} | ||||||
|
||||||
|
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.
The
command
variable appears to be a string in the original code, not an array. Calling.join(" ")
on a string will cause a runtime error. This should likely be just${command}
or the variable type needs to be verified.Copilot uses AI. Check for mistakes.