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

fix: Avoid icons imports #26

Closed
wants to merge 2 commits into from
Closed

fix: Avoid icons imports #26

wants to merge 2 commits into from

Conversation

ChaituVR
Copy link
Member

@ChaituVR ChaituVR commented Aug 5, 2024

Summary:

Related to snapshot-labs/sx-monorepo#577 (comment)

  • Add a new rule to avoid icon imports

Closes #24

How to test:

  • Go to any project, for example, in monorepo, edit package.json
    • Under eslintConfig add config:
"no-restricted-imports": [
        "error",
        {
          "patterns": [
            {
              "group": ["~icons/*"],
              "message": "No need to import icons directly, they are auto-imported"
            }
          ]
        }
      ]
    }
  • Try to import icon
  • see error
  • Untitled 8

TODO:

  • Run yarn release to update versions, before merging this PR

@ChaituVR ChaituVR marked this pull request as draft August 5, 2024 10:59
@ChaituVR ChaituVR marked this pull request as ready for review August 5, 2024 11:02
@ChaituVR ChaituVR requested review from wa0x6e and Sekhmet August 5, 2024 11:02
Copy link
Member

@Sekhmet Sekhmet left a comment

Choose a reason for hiding this comment

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

This won't work in all cases.

For example Landing.vue (it's imported to be used in JS, not template) or in pure .ts files.

@ChaituVR
Copy link
Member Author

ChaituVR commented Aug 5, 2024

ahh now i see what you mean

@ChaituVR ChaituVR closed this Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add lint to enforce camelCase event name
2 participants