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

Suggestion: create usable eslint rule for sorting to validate PRs #100

Open
FFdhorkin opened this issue Sep 14, 2023 · 1 comment
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@FFdhorkin
Copy link

Is your feature request related to a problem? Please describe.
I've been using the vscode extension for a few years and like it, but we have inconsistent adoption between team members and no way to enforce the rules.

Describe the solution you'd like
I'd like a plugin for eslint that provides the same sorting options (or at least verification thereof), but can be used to verify the rules are applied properly for PRs

Describe alternatives you've considered
I saw this Medium post earlier today, which talked about creating a custom rule for import grouping: https://medium.com/@pryvalov.bogddan/creating-custom-eslint-rule-grouping-up-imports-by-type-252a59ae5b02

It looks more straightforward to do that than I was expecting, and I was tempted to reinvent the wheel, but thought I'd create a suggestion here first

Additional context
N/A

@daidodo daidodo added enhancement New feature or request help wanted Extra attention is needed labels Sep 29, 2023
@daidodo
Copy link
Owner

daidodo commented Sep 29, 2023

Thanks for the feedback!

The plugin uses format-imports to do the job. There are 2 ways to validate whether some code follows the rules of the plugin:

At the moment, I'm busy on other things so please go ahead if you want to try. Hope the above info is helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants