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 declaration-* rules #5485

Merged
merged 1 commit into from Aug 18, 2021

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?

This change removes // @ts-nocheck from the remaining declaration-* rules.
Also, this adds 2 type parameters to the StylelintRule type to pass the type-check.

This change removes  `// @ts-nocheck` from the remaining `declaration-*` rules.
Also, this adds 2 type parameters to the `StylelintRule` type to pass the type-check.
@ybiquitous ybiquitous force-pushed the refactor-types-for-declaration-rules branch from 23a3c30 to dddf856 Compare August 18, 2021 15:02
secondaryOptions: Record<string, any>,
export type StylelintRule<P = any, S = any> = ((
primaryOption: P,
secondaryOptions: Record<string, S>,
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] P - Primary, S - Secondary

Copy link
Member

Choose a reason for hiding this comment

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

Why do not use full words? 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

I follow the existing style, but is using full words common? (I'm open to change)

export type StylelintConfigRuleSettings<T, O extends Object> =

type PropertyNamesOfType<T, U> = {

Copy link
Member

Choose a reason for hiding this comment

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

Let's follow the existing style. We can revisit the lot if it becomes an issue.

@ybiquitous ybiquitous marked this pull request as ready for review August 18, 2021 15:03
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.

Thanks as always, LGTM!

secondaryOptions: Record<string, any>,
export type StylelintRule<P = any, S = any> = ((
primaryOption: P,
secondaryOptions: Record<string, S>,
Copy link
Member

Choose a reason for hiding this comment

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

Let's follow the existing style. We can revisit the lot if it becomes an issue.

@jeddy3 jeddy3 merged commit 52f2474 into v14 Aug 18, 2021
@jeddy3 jeddy3 deleted the refactor-types-for-declaration-rules branch August 18, 2021 16:52
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

3 participants