-
Notifications
You must be signed in to change notification settings - Fork 49
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
Autofix rules #21
Comments
👍 Great idea. Not sure about |
Appending a |
W/regard to the I don't think we should auto-fix anything that modifies code behavior (unless maybe the user sets some other CLI option or environment variable? One exception to the above. I think removing |
But without it will make XO fail. So it will still fail. |
Does |
Warnings too. |
@sindresorhus: i would like to give it a try if it is still relevant. |
@florianb Sure. Go ahead. Seems like we couldn't agree on all of these yet, but you could start with autofixing for |
Great - i am sure a PR will stimulate discussions.. 😄 |
Hey everybody, i am stuck testing the Thank you very much! 💝 |
@florianb Just apply the fix mention in jfmengels/eslint-ava-rule-tester#5 locally to your node_modules and you should be able to debug it for now. |
@sindresorhus i guess this fix is not applicable since eslint forbids the modification of the AST. While it it would (probably) be possible to rename
I opened a corresponding SO-question without helpful responses. I guess i could start a bounty to raise attention but i can't think of any solution overcoming this barrier. I am really sorry that i just got stuck again. 😞 |
Keep it up, Florian. The light is ahead of the curve.
…On Fri, Mar 31, 2017, 12:53 Florian Breisch ***@***.***> wrote:
@sindresorhus <https://github.com/sindresorhus> i guess this fix is not
applicable since eslint forbids the modification of the AST. While it it
would (probably) be possible to rename .only into something different, i
can't remove it without causing the following exception:
Rule should not modify AST.
Actual:
[object Object]
Expected:
[object Object]
assertASTDidntChange (node_modules/eslint/lib/testers/rule-tester.js:406:24)
...
I opened a corresponding SO-question
<https://stackoverflow.com/questions/43043746/how-to-modify-the-javascript-ast-in-an-eslint-rule-fix>
without helpful responses. I guess i could start a bounty to raise
attention but i can't think of any solution overcoming this barrier.
I am really sorry that i just got stuck again. 😞
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAmyx8zhN7eb-uHslydazj9H6hF7W9umks5rrM0lgaJpZM4HkYpp>
.
|
@florianb Can you submit a WIP PR so we can take a look and maybe help? |
@sindresorhus - of course. Wait a minute.. 😄 |
@sindresorhus - created #173 |
Okaydo - heading on to implement the |
🎺 I'm heading over to implement the fixer for In thought of a fix for |
Haha. Sounds funny in theory, but I think people will not appreciate our humor. |
Cool ! As for That said, these tests could have be autofixed:
|
I agree. |
Sure - so just to check if i got you all right 😅:
|
Correct |
But I don't think we should do a fixer for |
For no-todo-implementation, I thought we could remove the todo modifier.
Yeah we definitely don't want to remove the test body.
…On Fri, Dec 8, 2017, 19:41 Sindre Sorhus ***@***.***> wrote:
But I don't think we should do no-todo-implementation. What if the user
accidentally wrote a test body and then we just remove it. Better for them
to just fix it manually.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADsK5Ftfe3rfgROJPe33AMJuAK7Cf1ajks5s-YLlgaJpZM4HkYpp>
.
|
Oh ok, makes more sense. I still don't think it should have a fixer though. |
Well - then thanks for extending the scope.. 😆 I'll ignore the |
@sindresorhus piggy-backing on this issue: IMO It can be actively harmful to auto-fix
By comparison, here's what happens with
|
@mmkal Yes, we plan to drop the auto-fixer for those rules. See: #281 (comment) |
Would be useful to support autofixing for some of the rules. Not all are possible.
http://eslint.org/docs/developer-guide/working-with-rules#contextreport
no-skip-test
(just remove theskip
modifier)no-only-test
(just remove theonly
modifier)no-identical-title
(append Discussion #1,no-cb-test
rule #2, etc, to the title)no-skip-assert
(just remove theskip
modifier)Can't think of any way to reliably fix the other rules, but input welcome!
The text was updated successfully, but these errors were encountered: