Skip to content
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

Enable no-unsafe-assignments for MSSQL #23407

Merged
merged 2 commits into from
Jun 18, 2023

Conversation

Charles-Gagnon
Copy link
Contributor

https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md

any is dangerous to use in a lot of situations, so wherever we can be explicit about not using it the better. I'm enabling this for the MSSQL extension, and then moving it to the extension-level eslintrc so that other extensions can easily enable it later if needed (and new extensions get it automatically).

Smallish number of fixes, none of them a concern that I saw.

@@ -223,7 +223,7 @@ export function getErrorMessage(error: Error | any, removeHeader: boolean = fals
if (error instanceof Error) {
errorMessage = error.message;
} else if (error.responseText) {
errorMessage = error.responseText;
errorMessage = error.responseText.toString() as string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why adding the .toString() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because error.responseText could be anything. It should always be a string (and was previously assumed to be so) so technically could get rid of it I guess. (yet again I really wish TS had better built in error support...)

@Charles-Gagnon Charles-Gagnon merged commit cdece24 into main Jun 18, 2023
@Charles-Gagnon Charles-Gagnon deleted the chgagnon/noUnsafeAssignments branch June 18, 2023 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants