lint-todo/eslint-formatter-todo

Updating TODO's deletes ember-template-lint TODOs

Closed this issue · 8 comments

What I expected to happen

Run UPDATE_TODO=1 eslint --format @scalvert/eslint-formatter-todo and see a list of new eslint TODOs

What actually happened

I ran UPDATE_TODO=1 eslint --format @scalvert/eslint-formatter-todo and saw a list of new eslint TODOs but also all existing ember-template-lint TODOs were deleted.


It looks like running eslint with this formatter deletes any TODOs that were created by https://github.com/ember-template-lint/ember-template-lint which I was not expecting to happen.

I see that you're involved with ember-template-lint so I imagine your intention would be to have them co-exist.

I see in the todo json file that an engine property is present which suggests that tools like this should be able to target only TODOs generated for this tool.

Am I doing something wrong or is this a legit bug?

I got around this by passing in ESLINT_TODO_DIR to use a different directory than .lint-todo which works. However, it feels like this shouldn't be necessary as the engine prop of the stored json files should be enough to allow the tool to work out which TODO's apply to it.

ESLINT_TODO_DIR="./.eslint-todo" UPDATE_TODO=1 yarn lint:js --format @scalvert/eslint-formatter-todo

Thanks for reporting @achambers!

I see that you're involved with ember-template-lint so I imagine your intention would be to have them co-exist.

Ya, they absolutely are being developed to work well together (and "feel" the same in both worlds). This is a bug for sure.

Oh wow this was a massive oversight on my part! Sorry for that, @achambers! I'll work on fixing this tomorrow. Thanks for reporting.

Thanks folks. Very much appreciated. Love your work :)

I’m happy to submit a PR myself, if that helps, if you can give me a steer on where to look.

It's all good. I should have this fixed by end of day. Was just testing an api to support this in the underlying todo-utils lib that both linting libraries use.