-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
vas3a
commented
Nov 11, 2022
- fixes lint errors for src-ts/utils
- fixes part of the lint errors in src-ts/tools/learn
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.
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 |
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.
I'm curious why use noop
instead of undefined?
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.
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"
src-ts/tools/learn/learn-lib/lesson-provider/lesson.provider.tsx
Outdated
Show resolved
Hide resolved
@@ -7,6 +7,8 @@ import { UserCertificationUpdateProgressActions } from './user-certification-upd | |||
|
|||
const certProgressPath: string = 'certification-progresses' | |||
|
|||
type GenericDataObject = { [key: string]: string | GenericDataObject } |
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.
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} |
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.
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.
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.
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)
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.
correct
TCA-499 eslint Add Line Breaks Before Chained Methods -> TCA-499_eslint
…der-platform/platform-ui into TCA-499_eslint_fix-linting
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.
looks good!!