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

Address XS code hygiene tasks #4981

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Address XS code hygiene tasks #4981

wants to merge 12 commits into from

Conversation

OEvgeny
Copy link
Collaborator

@OEvgeny OEvgeny commented Dec 21, 2023

part of #4968

Changelog Entry

(No changelog entry for code hygiene tasks)

Description

Address the first 3 suggestions from #4968

Design

Specific Changes

List of changes:

  • XS: Do not use React FC/VFC types, use Props instead
  • XS: Mark all props as read-only, also any arrays and objects under it
  • XS: Prefer import { type ABC } over import type { ABC }

-

  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@OEvgeny
Copy link
Collaborator Author

OEvgeny commented Jan 2, 2024

@compulim if anything is missing, please let me know!

__tests__/types/tsconfig.json Outdated Show resolved Hide resolved
Address the first 3 suggestions from #4968

As we remove `FC/VFC` I thought it'd be nice to add `ReactNode` return type basically to:
- Serve as an additional hint that the function follows React Component signature
- Limit usage of unsupported by React runtime return types
Copy link
Collaborator Author

@OEvgeny OEvgeny left a comment

Choose a reason for hiding this comment

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

Went through the files and fixed the following:

  • Removed PropsWithChildren
  • Sorted imports and props

@OEvgeny OEvgeny mentioned this pull request May 17, 2024
37 tasks
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.

1 participant