Skip to content

Tca 499 eslint fix linting #410

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

Merged
merged 12 commits into from
Nov 14, 2022
Merged

Conversation

vas3a
Copy link
Collaborator

@vas3a vas3a commented Nov 11, 2022

  • fixes lint errors for src-ts/utils
  • fixes part of the lint errors in src-ts/tools/learn

@vas3a vas3a self-assigned this Nov 11, 2022
Copy link
Contributor

@brooketopcoder brooketopcoder left a comment

Choose a reason for hiding this comment

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

Thank you so much for doing this!

It's already so much easier to read.

@@ -24,7 +25,7 @@ export function useCourses(provider: string, certification?: string): CoursesPro
loading: false,
ready: false,
}))
return
return noop
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious why use noop instead of undefined?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh. sorry. The error confused me and I didn't look it up. I didn't realize I can just return undefined. Here's the error:
Arrow function expected no return value.eslint[consistent-return](https://eslint.org/docs/rules/consistent-return)

By consistent-return I immediately was thinking of "you need to return a function here as well"

@@ -7,6 +7,8 @@ import { UserCertificationUpdateProgressActions } from './user-certification-upd

const certProgressPath: string = 'certification-progresses'

type GenericDataObject = { [key: string]: string | GenericDataObject }
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this! Maybe we should make this globally available? I am sure there are other places that would use this. It seems strange that TS doesn't provide something like this OTB.

@@ -68,7 +70,7 @@ const Account: FC<{}> = () => {
<Button
label='edit name'
onClick={toggleEditName}
tabIndex={1}
tabIndex={-1}
Copy link
Contributor

Choose a reason for hiding this comment

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

These are explicitly set to 1 and 2 bc of the weirdness of the form in the modal. That's why I left this rule a warning instead of an error.

Copy link
Collaborator Author

@vas3a vas3a Nov 11, 2022

Choose a reason for hiding this comment

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

I see. we should probably disable the rule for the file in this case, right? (as this is unavoidable and it will just keep warning otherwise)

Copy link
Contributor

Choose a reason for hiding this comment

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

correct

Copy link
Contributor

@brooketopcoder brooketopcoder left a comment

Choose a reason for hiding this comment

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

looks good!!

@brooketopcoder brooketopcoder merged commit aed04fc into TCA-499_eslint Nov 14, 2022
@brooketopcoder brooketopcoder deleted the TCA-499_eslint_fix-linting branch November 14, 2022 18:11
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.

3 participants