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

Enhance no-deprecated-classnames Rule for Auto-fixable Functionality in @metamask/eslint-plugin-design-tokens #13

Open
georgewrmarshall opened this issue Apr 4, 2024 · 0 comments
Labels
team-design-system All issues relating to design system

Comments

@georgewrmarshall
Copy link
Collaborator

Description

To further streamline the development process and reinforce adherence to our design system, we propose an enhancement to the @metamask/eslint-plugin-design-tokens library, specifically targeting the no-deprecated-classnames rule. This improvement aims to introduce auto-fixable functionality to the rule, allowing it to not only flag the use of deprecated classnames but also automatically replace them with their direct replacements when possible. This feature will significantly reduce manual refactoring efforts, ensuring a more efficient workflow and consistent application of design tokens across our codebase.

Technical Details

  • Objective: Update the no-deprecated-classnames rule within the @metamask/eslint-plugin-design-tokens library to support auto-fixable functionality for classnames with direct replacements.
  • Implementation Strategy:
    1. Identify all deprecated classnames that have direct, one-to-one replacements within the design system.
    2. Enhance the no-deprecated-classnames rule logic to not only flag these deprecated classnames but also suggest specific replacements.
    3. Implement auto-fixable functionality within the rule, allowing developers to automatically apply suggested replacements with ESLint's --fix option.
  • Testing and Validation: Ensure thorough testing of the enhanced rule to confirm its accuracy in identifying deprecated classnames and its effectiveness in applying fixes without introducing errors or unintended changes.

Acceptance Criteria

  • The no-deprecated-classnames rule is capable of automatically fixing instances of deprecated classnames with direct replacements.
  • Developers can use ESLint's --fix option to apply suggested classname replacements, streamlining the update process.
  • The enhancement does not compromise the accuracy of the rule in flagging deprecated classnames or the stability of the codebase.
  • Documentation for the @metamask/eslint-plugin-design-tokens library is updated to include information on the auto-fixable functionality and guidance on its use.

Additional Notes

This enhancement is a proactive measure to maintain the integrity of our design system within our codebase and to support our developers with tools that facilitate adherence to best practices. By automating the replacement of deprecated classnames, we not only ensure consistency across our projects but also enhance developer productivity and satisfaction.

@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-design-system All issues relating to design system
Projects
None yet
Development

No branches or pull requests

1 participant