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

[Todo feature] Missing newline when generating remove lines in .lint-todo #2482

Closed
Windvis opened this issue Apr 21, 2022 · 7 comments · Fixed by #2955
Closed

[Todo feature] Missing newline when generating remove lines in .lint-todo #2482

Windvis opened this issue Apr 21, 2022 · 7 comments · Fixed by #2955

Comments

@Windvis
Copy link
Contributor

Windvis commented Apr 21, 2022

After fixing some linting errors that were previously added to the .lint-todo file I ran npm run lint:hbs to check if I didn't create any new issues. To my confusion a totally unrelated linting error was shown.

Upon inspection of the .lint-todo file, I noticed that new remove prefixed lines were added but the first one didn't start on a new line and instead started right at the end of the previous add line which made the error appear again in the linting output:

... other lines that were added previously
add|ember-template-lint|simple-unless|134|8|134|8|02b279bc993a1ee6632c7e6edf341a2aabc519cb|1649980800000|||app/templates/subsidy/applications/edit/step/edit.hbsremove|ember-template-lint|no-action|51|20|51|20|9d210688d82ca2d429ebdcf858994aa0c1da7828|1649980800000|||app/components/shared/persoon/create-persoon.hbs
... other remove lines

Manually moving it to a new line makes it work as expected again.

@angelayanpan
Copy link
Contributor

angelayanpan commented Jun 6, 2022

Screen Shot 2022-06-06 at 4 08 40 PM

@angelayanpan
Copy link
Contributor

also running into this bug

@angelayanpan
Copy link
Contributor

angelayanpan commented Jun 6, 2022

I saw this behavior after I fixed some "no-implicit-this" errors in a .hbs file.
then after running: yarn ember-template-lint . --update-todo
I saw the "remove" attached to a previous line. not starting on a new line.

@angelayanpan
Copy link
Contributor

this doesn't just happen with "remove", I have also seen "add" not on a new line as well.

@Techn1x
Copy link
Contributor

Techn1x commented Aug 12, 2023

This could have been fixed already, but should be fixed for sure in @lint-todo/utils 13.1.1
lint-todo/utils#578

I've posted a PR for ember-template-lint to update to it
#2955

@Techn1x
Copy link
Contributor

Techn1x commented Aug 12, 2023

The issue was that certain commands were not applying a newline to the end of the file, depending on what version you were using. Then, after that, if you did an append operation (like update-todo) it would be joined to the line prior since there was no newline.

13.1.1 should have fixed all the remaining commands to apply a newline after their output - but if you have a .lint-todo file from a prior version it still might not have the newline at the end until you run your next command, so it's possible you'll end up with one more doubled todo operation line, then it'll be resolved.

@bmish
Copy link
Member

bmish commented Aug 12, 2023

Should be fixed by #2955.

@bmish bmish closed this as completed Aug 12, 2023
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 a pull request may close this issue.

4 participants