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

Add autofix #10

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add autofix #10

wants to merge 4 commits into from

Conversation

pawk3k
Copy link

@pawk3k pawk3k commented Mar 13, 2022

Thanks for your eslint plugin , i was inspired by import order
Also when building this PR , i thought it could be just a part of regular eslint , it's only function call order and nothing else, but since i was working on this project as starting point ,i thought it would be easier to get through.

  • updated tests
  • add fix option for hooks

@walterholohan
Copy link

Great idea @pawk3k , autoFix will be very useful as I tried adding this library to an existing project but it will take too long to manually go through and fix everything

@hiukky hiukky added the enhancement New feature or request label Mar 15, 2022
Copy link
Owner

@hiukky hiukky left a comment

Choose a reason for hiding this comment

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

@pawk3k Thanks for your time and contribution! This is a feature that should have been implemented by now but I haven't had time to work on it yet. At the moment I can't merge this PR as it has a lot of code to analyze and my interest is to implement it as cleanly as possible.

I've been testing locally and it doesn't seem to be working as expected, we also have some patterns to follow, so if you can work the typescript code better without disabling rules or comments to ignore compilation errors, that would be great.

But I don't rule out this contribution, let's just improve this implementation.

@pawk3k
Copy link
Author

pawk3k commented Mar 18, 2022

@hiukky Thanks for your review, when i have time i will update typing and will try to simplify some code , thanks for your time.

@hiukky
Copy link
Owner

hiukky commented Apr 5, 2022

About this feature, I'm working on it at https://github.com/hiukky/eslint-plugin-hooks/tree/feature/autofix for anyone who wants to test or work on it.

The feature itself already works in a real application by the tests I did, but I still have some problems with Eslint's test feature because the feature is functional but some cases are breaking tests.

So far I've done tests with line comments and blocks before the function declaration and inside the function itself, but we still have some cases like comments at the end of the block (same line).

// IT WORKS
function foo() {
   // IT WORKS
} // STILL DOES NOT WORK

/**
  * IT WORKS
  */
function bar() {
   /**
    * IT WORKS
    */
} // STILL DOES NOT WORK

@pawk3k if you're still willing to work on it, you can track this branch, this implementation is simpler.

This feature will be released in version 0.5.0!

@OBKoro1
Copy link

OBKoro1 commented Apr 14, 2022

@hiukky
Thank you very much for your work. I'm looking forward to the automatic repair function online. Please tell me how long can you complete it?

@hiukky
Copy link
Owner

hiukky commented Apr 14, 2022

Thank you @OBKoro1 ! I can't tell you when this will be released due to my time limitation and involvement with other projects, but I'll try to give a little more attention to this feature and release an alpha version later this week, for those who want and testing, even because I already receive some bug feedbacks.

@rozekfr
Copy link

rozekfr commented Jun 29, 2023

Hi @hiukky
Is it possible to merge this feature to new version? Thank you.

@EliasVal
Copy link

@hiukky Is development going to resume anytime? Because if not I think it's better someone else forks the repo and continues development, maybe @pawk3k :)

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

Successfully merging this pull request may close these issues.

6 participants