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

feat: Enable @react-native/platform-colors rule #275

Merged
merged 3 commits into from
Jun 10, 2024
Merged

Conversation

retyui
Copy link
Contributor

@retyui retyui commented Jun 10, 2024

Summary

Test plan

see: test/PlatformColor.js

@retyui retyui requested a review from jaworek June 10, 2024 12:30
rules: {
'@react-native/platform-colors': WARNING,
Copy link
Member

Choose a reason for hiding this comment

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

can we turn on all recommended rules?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@react-native plugin is exported only one rule )

test/PlatformColor.js Outdated Show resolved Hide resolved
Comment on lines +5 to +9
PlatformColor(); // required at least one argument
// eslint-disable-next-line @react-native/platform-colors
PlatformColor([], {}); // arguments must be string literals
// eslint-disable-next-line @react-native/platform-colors
DynamicColorIOS('red'); // required object as first argument
Copy link
Member

Choose a reason for hiding this comment

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

tbh looks like TS should take care of these

Copy link
Contributor Author

Choose a reason for hiding this comment

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

of course TS will catch it early
but it still useful for JS projects

Co-authored-by: Michał Pierzchała <[email protected]>
@retyui retyui merged commit eaeb4a6 into main Jun 10, 2024
1 check passed
@retyui retyui deleted the platform-colors branch June 10, 2024 12:44
@thymikee
Copy link
Member

Published in v14.2.0. Next time please use "squash and merge" instead of just merging, it helps me keep the commit history tidy.

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.

2 participants