gitpod-io / gitpod

The developer platform for on-demand cloud development environments to create software faster and more securely.
https://www.gitpod.io
GNU Affero General Public License v3.0
12.84k stars 1.23k forks source link

[dashboard] Lint warnings #3841

Closed aledbf closed 5 months ago

aledbf commented 3 years ago

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 https://github.com/gitpod-io/gitpod/pull/3830 Run craco build

Expected behavior

-

Example repository

-

jankeromnes commented 3 years ago

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 commented 2 years ago

I'm going to work on this after #7757 if it's still available ๐Ÿ’ช

trumbitta commented 2 years ago

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

geropl commented 2 years ago

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

Palanikannan1437 commented 1 year ago

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

trumbitta commented 1 year ago

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

No problem for me ๐Ÿป

svenefftinge commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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!

stale[bot] commented 1 year ago

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[bot] commented 1 year ago

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.