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

Refactor to improve types for property-* rules #5833

Merged
merged 1 commit into from Jan 17, 2022

Conversation

ybiquitous
Copy link
Member

Which issue, if any, is this issue related to?

Part of #4496

Is there anything in the PR that needs further explanation?

  • Remove // @ts-nocheck to enable type-checking.
  • Improve the code a bit for type safety.

if (selector && optionsMatches(options, 'ignoreSelectors', selector)) {
if (
parent &&
isRule(parent) &&
Copy link
Member Author

Choose a reason for hiding this comment

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

[note] Only Rule node has a selector property. If not using isRule() and just using the in operator (like 'selector' in parent, the TypeScript compiler cannot ensure that the parent variable has a selector property.

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

All looks good to me, thanks!

@ybiquitous ybiquitous merged commit 76fb420 into main Jan 17, 2022
@ybiquitous ybiquitous deleted the refactor-property-rules branch January 17, 2022 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants