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

[dashboard] Lint warnings #3841

Closed
aledbf opened this issue Apr 8, 2021 · 13 comments · Fixed by #16158
Closed

[dashboard] Lint warnings #3841

aledbf opened this issue Apr 8, 2021 · 13 comments · Fixed by #16158
Assignees
Labels
component: dashboard meta: stale This issue/PR is stale and will be closed soon

Comments

@aledbf
Copy link
Member

aledbf commented Apr 8, 2021

Bug description

Compiled with warnings.

src/App.tsx
  Line 57:8:   React Hook useEffect has a missing dependency: 'setUser'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  Line 67:13:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images   jsx-a11y/alt-text

src/Login.tsx
  Line 26:9:    img elements must have an alt prop, either with meaningful text, or an empty string for decorative images   jsx-a11y/alt-text
  Line 71:8:    React Hook useEffect has a missing dependency: 'setUser'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  Line 86:25:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images   jsx-a11y/alt-text
  Line 112:29:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images   jsx-a11y/alt-text
  Line 122:41:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images   jsx-a11y/alt-text

src/admin/UserSearch.tsx
  Line 41:8:  React Hook useEffect has a missing dependency: 'searchResult.rows'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

src/admin/WorkspacesSearch.tsx
  Line 51:8:  React Hook useEffect has a missing dependency: 'searchResult.rows'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  Line 57:8:  React Hook useEffect has a missing dependency: 'search'. Either include it or remove the dependency array             react-hooks/exhaustive-deps

src/components/Menu.tsx
  Line 49:21:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text

src/components/Modal.tsx
  Line 44:8:  React Hook useEffect has a missing dependency: 'handler'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

src/settings/EnvironmentVariables.tsx
  Line 29:45:   Unexpected whitespace after spread property operator  rest-spread-spacing
  Line 137:38:  Unnecessary escape character: \*                      no-useless-escape

src/settings/Integrations.tsx
  Line 48:8:    React Hook useEffect has a missing dependency: 'updateCurrentScopes'. Either include it or remove the dependency array                                                                                                                                                                                                                                                                                                                           react-hooks/exhaustive-deps
  Line 443:8:   React Hook useEffect has missing dependencies: 'props.mode', 'props.provider.host', 'props.provider.oauth.callBackUrl', 'props.provider.oauth.clientId', 'props.provider.oauth.clientSecret', and 'props.provider.type'. Either include them or remove the dependency array. If 'setType' needs the current value of 'props.provider.type', you can also switch to useReducer instead of useState and read 'props.provider.type' in the reducer  react-hooks/exhaustive-deps
  Line 447:8:   React Hook useEffect has a missing dependency: 'validate'. Either include it or remove the dependency array                                                                                                                                                                                                                                                                                                                                      react-hooks/exhaustive-deps
  Line 545:19:  Using target="_blank" without rel="noreferrer" is a security risk: see https://html.spec.whatwg.org/multipage/links.html#link-type-noopener                                                                                                                                                                                                                                                                                                      react/jsx-no-target-blank
  Line 546:13:  Using target="_blank" without rel="noreferrer" is a security risk: see https://html.spec.whatwg.org/multipage/links.html#link-type-noopener                                                                                                                                                                                                                                                                                                      react/jsx-no-target-blank
  Line 567:21:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                                                                                                                                                                        jsx-a11y/alt-text
  Line 594:25:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                                                                                                                                                                        jsx-a11y/alt-text
  Line 611:21:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                                                                                                                                                                        jsx-a11y/alt-text
  Line 617:21:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                                                                                                                                                                        jsx-a11y/alt-text

src/settings/Notifications.tsx
  Line 21:20:  Unexpected whitespace after spread property operator  rest-spread-spacing
  Line 22:24:  Unexpected whitespace after spread property operator  rest-spread-spacing
  Line 24:28:  Unexpected whitespace after spread property operator  rest-spread-spacing

src/settings/Plans.tsx
  Line 35:1:     Unexpected default export of anonymous function                                                                                                                                                                                                                                                                                                                   import/no-anonymous-default-export
  Line 73:8:     React Hook useEffect has missing dependencies: 'handleTeamClaim', 'pollAccountStatementTimeout', and 'server'. Either include them or remove the dependency array                                                                                                                                                                                                 react-hooks/exhaustive-deps
  Line 110:39:   Unexpected mix of '&&' and '||'                                                                                                                                                                                                                                                                                                                                   no-mixed-operators
  Line 110:81:   Unexpected mix of '&&' and '||'                                                                                                                                                                                                                                                                                                                                   no-mixed-operators
  Line 207:70:   Expected '===' and instead saw '=='                                                                                                                                                                                                                                                                                                                               eqeqeq
  Line 234:18:   Unexpected whitespace after spread property operator                                                                                                                                                                                                                                                                                                              rest-spread-spacing
  Line 253:70:   Expected '===' and instead saw '=='                                                                                                                                                                                                                                                                                                                               eqeqeq
  Line 274:18:   Unexpected whitespace after spread property operator                                                                                                                                                                                                                                                                                                              rest-spread-spacing
  Line 298:81:   The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
  Line 298:127:  Script URL is a form of eval                                                                                                                                                                                                                                                                                                                                      no-script-url
  Line 321:81:   The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
  Line 321:127:  Script URL is a form of eval                                                                                                                                                                                                                                                                                                                                      no-script-url
  Line 347:81:   The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
  Line 347:127:  Script URL is a form of eval                                                                                                                                                                                                                                                                                                                                      no-script-url
  Line 396:21:   The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
  Line 396:118:  Script URL is a form of eval                                                                                                                                                                                                                                                                                                                                      no-script-url
  Line 398:33:   The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
  Line 398:85:   Script URL is a form of eval                                                                                                                                                                                                                                                                                                                                      no-script-url
  Line 399:29:   The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
  Line 399:81:   Script URL is a form of eval                                                                                                                                                                                                                                                                                                                                      no-script-url
  Line 405:17:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                                                                                         jsx-a11y/alt-text
  Line 406:129:  Using target="_blank" without rel="noreferrer" is a security risk: see https://html.spec.whatwg.org/multipage/links.html#link-type-noopener                                                                                                                                                                                                                       react/jsx-no-target-blank
  Line 413:25:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                                                                                         jsx-a11y/alt-text
  Line 417:25:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                                                                                         jsx-a11y/alt-text
  Line 430:25:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                                                                                         jsx-a11y/alt-text
  Line 539:62:   Expected '===' and instead saw '=='                                                                                                                                                                                                                                                                                                                               eqeqeq

src/settings/Preferences.tsx
  Line 39:25:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
  Line 44:25:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text

src/settings/Teams.tsx
  Line 108:8:    React Hook useEffect has a missing dependency: 'pollForAdditionalSlotsBought'. Either include it or remove the dependency array                     react-hooks/exhaustive-deps
  Line 154:8:    React Hook useEffect has missing dependencies: 'isChargebeeCustomer' and 'pendingPlanPurchase'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
  Line 162:8:    React Hook useEffect has a missing dependency: 'pendingSlotsPurchase'. Either include it or remove the dependency array                             react-hooks/exhaustive-deps
  Line 463:119:  Using target="_blank" without rel="noreferrer" is a security risk: see https://html.spec.whatwg.org/multipage/links.html#link-type-noopener         react/jsx-no-target-blank
  Line 576:25:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                           jsx-a11y/alt-text
  Line 605:8:    React Hook useEffect has a missing dependency: 'getPlan'. Either include it or remove the dependency array                                          react-hooks/exhaustive-deps
  Line 627:17:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                           jsx-a11y/alt-text
  Line 663:8:    React Hook useEffect has a missing dependency: 'plan.chargebeeId'. Either include it or remove the dependency array                                 react-hooks/exhaustive-deps
  Line 705:17:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                           jsx-a11y/alt-text
  Line 755:10:   'Slot' is already defined                                                                                                                           @typescript-eslint/no-redeclare
  Line 842:44:   Unexpected mix of '&&' and '||'                                                                                                                     no-mixed-operators
  Line 842:121:  Unexpected mix of '&&' and '||'                                                                                                                     no-mixed-operators
  Line 863:21:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                           jsx-a11y/alt-text

src/settings/settings-menu.ts
  Line 7:1:  Assign array to a variable before exporting as module default  import/no-anonymous-default-export

src/start/CreateWorkspace.tsx
  Line 270:6:   React Hook useEffect has a missing dependency: 'p.error.data'. Either include it or remove the dependency array                                                                                                                                                                               react-hooks/exhaustive-deps
  Line 301:21:  Assignments to the 'pollTimeout' variable from inside React Hook useEffect will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside useEffect  react-hooks/exhaustive-deps

src/start/StartPage.tsx
  Line 85:7:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text

src/start/StartWorkspace.tsx
  Line 103:9:  Do not assign to the exception parameter                                                                                                  no-ex-assign
  Line 312:7:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                 jsx-a11y/alt-text
  Line 345:6:  React Hook useEffect has missing dependencies: 'logsEmitter' and 'props.workspaceId'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
  Line 373:6:  React Hook useEffect has missing dependencies: 'logsEmitter' and 'props.workspaceId'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

src/utils.ts
  Line 30:27:  Function declared in a loop contains unsafe references to variable(s) 'delayInSeconds'  no-loop-func

src/workspaces/StartWorkspaceModal.tsx
  Line 35:55:  React Hook useEffect has a missing dependency: 'computeSelection'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

src/workspaces/WorkspaceEntry.tsx
  Line 167:42:  Comparing to itself is potentially pointless  no-self-compare
  Line 173:41:  Comparing to itself is potentially pointless  no-self-compare
  Line 179:42:  Comparing to itself is potentially pointless  no-self-compare

src/workspaces/Workspaces.tsx
  Line 119:41:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text

Steps to reproduce

Requires changes from #3830
Run craco build

Expected behavior

Example repository

@svenefftinge svenefftinge added this to the [backlog] April 2021 milestone Apr 8, 2021
@geropl geropl modified the milestones: April 2021, May 2021 (backlog) Apr 13, 2021
@AlexTugarev AlexTugarev modified the milestones: May 2021 (backlog), [do-not-add-issues] May 2021 May 3, 2021
@jankeromnes
Copy link
Contributor

We should probably turn these warnings into errors.

Also, in order not to suddenly break everyone's build, maybe we can add problematic files to a .eslintignore file, and the gradually work towards making that file smaller.

@trumbitta
Copy link
Contributor

I'm going to work on this after #7757 if it's still available 💪

@trumbitta
Copy link
Contributor

Ok #8655 landed and I can confirm I'm pretty much ready (and pumped) to start working on this

@geropl
Copy link
Member

geropl commented Mar 10, 2022

@trumbitta That would be nice. And thanks again for basically initiating the internal prettier discussion. 😉

@Palanikannan1437
Copy link
Contributor

Hey @gtsiolis @trumbitta @svenefftinge I'd love to work on this!

@trumbitta
Copy link
Contributor

Hey @gtsiolis @trumbitta @svenefftinge I'd love to work on this!

No problem for me 🍻

@svenefftinge
Copy link
Member

Cool! We just yesterday talked about prioritizing this. 🙏
Please start out with a change that would fix the warnings that are obvious and easy to fix, but suppress (using a comment) those that might have unforeseen implications.

@Palanikannan1437
Copy link
Contributor

Cool! We just yesterday talked about prioritizing this. 🙏
Please start out with a change that would fix the warnings that are obvious and easy to fix, but suppress (using a comment) those that might have unforeseen implications.

For sure @svenefftinge will come out with a PR soon!

Also how would you suggest I go about the PRs...should I break it down into many (each solving a particular type of warning) or just one PR with all the changes!

@geropl
Copy link
Member

geropl commented Jan 26, 2023

Also how would you suggest I go about the PRs...should I break it down into many (each solving a particular type of warning) or just one PR with all the changes!

IMO the scope should make sense for you as author, but please keep in mind that it needs to be reviewable. So maybe one per page / big component / section of the UI (for example: personal settings?)
Does that make sense?

@Palanikannan1437
Copy link
Contributor

Palanikannan1437 commented Jan 26, 2023

Also how would you suggest I go about the PRs...should I break it down into many (each solving a particular type of warning) or just one PR with all the changes!

IMO the scope should make sense for you as author, but please keep in mind that it needs to be reviewable. So maybe one per page / big component / section of the UI (for example: personal settings?) Does that make sense?

Ohhh got it, yup it certainly does, thank you so much!

@gtsiolis @trumbitta I'm absolutely loving working on this PR....I've learnt so much on how the frontend side of Gitpod works...super duper cool stuff...thanks for assigning this to me!

@Palanikannan1437
Copy link
Contributor

Hey @gtsiolis ,just a part of this is completed and there's a lot to do...maybe the bot misunderstood haha🙃

Could you please open this again? Thank you!

@gtsiolis gtsiolis reopened this Feb 14, 2023
@gtsiolis gtsiolis removed this from the [backlog] June 2021 milestone Feb 14, 2023
@stale
Copy link

stale bot commented May 22, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label May 22, 2023
@stale stale bot removed the meta: stale This issue/PR is stale and will be closed soon label May 26, 2023
@stale
Copy link

stale bot commented Sep 16, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Sep 16, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dashboard meta: stale This issue/PR is stale and will be closed soon
Projects
None yet
9 participants