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 plugin:react/recommended ESLint rules #34329

Open
Tracked by #46670
ravicious opened this issue Nov 8, 2023 · 1 comment
Open
Tracked by #46670

Enable plugin:react/recommended ESLint rules #34329

ravicious opened this issue Nov 8, 2023 · 1 comment
Labels
developer-experience Addressing these issues will improve the experience of developers working on Teleport effort:low Tasks which can be completed within a few hours. ui value:low Tasks which completion brings comparatively low benefits.

Comments

@ravicious
Copy link
Member

ravicious commented Nov 8, 2023

The recommended set of lint rules includes many helpful rules such as react/jsx-key.

Just simply enabling the recommended rules causes ~260 errors to pop up. Majority of the violations are for:

Disabling those rules and running an autofix brings us to only about 20 violations which can be directly addressed:

/Users/rav/src/teleport/e/web/teleport/src/Billing/Summary/Cycle.tsx
  126:13  error  Missing "key" prop for element in iterator  react/jsx-key
  171:13  error  Missing "key" prop for element in iterator  react/jsx-key

/Users/rav/src/teleport/web/packages/design/src/Card/Card.story.tsx
  41:9  error  Missing "key" prop for element in iterator  react/jsx-key

/Users/rav/src/teleport/web/packages/design/src/Menu/Menu.jsx
  34:14  error  Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode  react/no-find-dom-node
  37:12  error  Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode  react/no-find-dom-node
  45:22  error  Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode  react/no-find-dom-node

/Users/rav/src/teleport/web/packages/design/src/Modal/Portal.jsx
   61:24  error  Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode  react/no-find-dom-node
  112:10  error  Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode  react/no-find-dom-node
  116:24  error  Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode  react/no-find-dom-node

/Users/rav/src/teleport/web/packages/design/src/Modal/RootRef.jsx
  23:16  error  Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode  react/no-find-dom-node
  28:17  error  Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode  react/no-find-dom-node

/Users/rav/src/teleport/web/packages/design/src/Popover/Popover.jsx
  330:31  error  Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode  react/no-find-dom-node

/Users/rav/src/teleport/web/packages/design/src/Popover/Transition.jsx
  22:18  error  Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode  react/no-find-dom-node

/Users/rav/src/teleport/web/packages/design/src/ResourceIcon/ResourceIcon.story.tsx
  30:9  error  Missing "key" prop for element in iterator  react/jsx-key

/Users/rav/src/teleport/web/packages/shared/components/UnifiedResources/UnifiedResources.tsx
  395:25  error  Missing "key" prop for element in iterator  react/jsx-key

/Users/rav/src/teleport/web/packages/teleport/src/Player/ProgressBar/Slider/Slider.jsx
  270:7  error  Do not mutate state directly. Use setState()  react/no-direct-mutation-state
  273:7  error  Do not mutate state directly. Use setState()  react/no-direct-mutation-state
@ravicious ravicious added ui developer-experience Addressing these issues will improve the experience of developers working on Teleport labels Nov 8, 2023
@ravicious
Copy link
Member Author

Violations in existing files could be also ignored, see #35027.

@ravicious ravicious added effort:low Tasks which can be completed within a few hours. value:low Tasks which completion brings comparatively low benefits. labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer-experience Addressing these issues will improve the experience of developers working on Teleport effort:low Tasks which can be completed within a few hours. ui value:low Tasks which completion brings comparatively low benefits.
Projects
None yet
Development

No branches or pull requests

1 participant