Skip to content

Conversation

alizedebray
Copy link
Contributor

@alizedebray alizedebray commented Sep 1, 2025

This PR implements a rule common rule creator for all rules that aim to replace a class with another.
The createClassUpdateRule could be used with simple properties:

{
  name: string; // name of the rule 
  description: string; // description of the rule 
  messages: Record<string, string>;  // error messages as { messageId: 'message text' }
  mutations: Record<string, [string] | [string, string]>; // actual class updates as { messageId: ['oldClass', 'newClass'] }
  type?: 'suggestion' | 'layout' | 'problem'; // rule type (defaults to 'problem')
}

Advantages:

  • Simpler development for the rule
  • Easy to update all rule at once

Disadvantages:

  • Less flexible rules

Vote:
🎉 to use the createClassUpdateRule creator
🚀 to right individual rules

Copy link

changeset-bot bot commented Sep 1, 2025

⚠️ No Changeset found

Latest commit: 6e2defc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@swisspost-bot
Copy link
Contributor

swisspost-bot commented Sep 1, 2025

Related Previews

@alizedebray alizedebray added the needs: 🏓 dev roundtable To be discussed at the roundtable of esteemed developers label Sep 4, 2025
@github-project-automation github-project-automation bot moved this from 👀 Triage to 🧐 In Review in Design System Production Board Sep 11, 2025
@leagrdv leagrdv linked an issue Sep 11, 2025 that may be closed by this pull request
@alionazherdetska alionazherdetska removed the needs: 🏓 dev roundtable To be discussed at the roundtable of esteemed developers label Sep 11, 2025
@alizedebray alizedebray marked this pull request as ready for review September 16, 2025 14:40
@alizedebray alizedebray requested a review from a team as a code owner September 16, 2025 14:40
Copy link

@alizedebray alizedebray merged commit bff2071 into main Sep 17, 2025
12 checks passed
@alizedebray alizedebray deleted the eslint-replacement-rule-proposal branch September 17, 2025 09:04
@github-project-automation github-project-automation bot moved this from 🧐 In Review to 🚀 Done in Design System Production Board Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🚀 Done
Development

Successfully merging this pull request may close these issues.

Propose common rule creator for ESLint packages
5 participants