-
Notifications
You must be signed in to change notification settings - Fork 20
feat(eslint): automigration rules to update gutter utilities #6237
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: be959ed The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Related Previews |
…4-migration-rules-for-the-gutter-utility
export function createTwoPhasesRules( | ||
data: TwoPhasesData, | ||
name: string, | ||
descriptionPhase1: string, | ||
descriptionPhase2: string, | ||
): { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this function signature to something like this:
export function createTwoPhasesRules( | |
data: TwoPhasesData, | |
name: string, | |
descriptionPhase1: string, | |
descriptionPhase2: string, | |
): { | |
type RuleType = Rule.RuleMetaData['type']; | |
type RuleMessages = Rule.RuleMetaData['messages']; | |
interface RuleConfigBase { | |
name: string; | |
type?: RuleType; | |
} | |
interface PhaseConfig<T>{ | |
description: string; | |
messages: T; | |
mutations: Record<keyof T, [string] | [string, string]>; | |
} | |
interface TwoPhaseRuleConfig<T, U> extends RuleConfigBase { | |
phases: [PhaseConfig<T>, PhaseConfig<U>]; | |
} | |
const createTwoPhasesClassUpdateRule = <T extends RuleMessages, U extends RuleMessages>( | |
config: TwoPhaseRuleConfig<T, U> | |
): { |
This way, descriptions are included into the phase data and we ensure message keys and mutation keys are always matching.
Then the RuleConfig
interface could be turned into:
type SinglePhaseRuleConfig<T> = RuleConfigBase & PhaseConfig<T>;
|
📄 Description
Automigration rules for the gutter utility + two phase rules refactoring