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

expiring-todo-comments should include the comment itself in the report #401

Closed
fregante opened this issue Sep 27, 2019 · 8 comments · Fixed by #816
Closed

expiring-todo-comments should include the comment itself in the report #401

fregante opened this issue Sep 27, 2019 · 8 comments · Fixed by #816

Comments

@fregante
Copy link
Collaborator

fregante commented Sep 27, 2019

Copied from eslint/eslint#12327


I think the point of this rule is to keep track of TODO comments, however this is hard to follow; I'd have to open each file separately to see if I can handle a task.

Current

  source/globals.d.ts:1:11:1   Unexpected todo comment.                                                                   no-warning-comments2:1   Unexpected todo comment.                                                                   no-warning-comments

  source/libs/post-form.ts:9:39:3   Unexpected todo comment.                                                                   no-warning-comments

  source/features/hidden-review-comments-indicator.tsx:37:237:2   Unexpected todo comment.                                                                   no-warning-comments

  source/features/revert-file.tsx:89:489:4   Unexpected todo comment.                                                                   no-warning-comments

Ideal

  source/globals.d.ts:1:11:1   Unexpected todo comment: Drop ignore after #9.                                                                  no-warning-comments2:1   Unexpected todo comment: Find this info on the page.                                                                   no-warning-comments

  source/libs/post-form.ts:9:39:3   Unexpected todo comment: Improve JSX types for event listeners so we can use... [clipped]                                                                   no-warning-comments

  source/features/hidden-review-comments-indicator.tsx:37:237:2   Unexpected todo comment: Drop some definitions when their related bugs are resolved                                                                   no-warning-comments

  source/features/revert-file.tsx:89:489:4   Unexpected todo comment: Drop `as` after https://github.com/microsoft/TSJS-lib-generator/issues/741                                                                   no-warning-comments

Or

  source/globals.d.ts:1:11:1   TODO: Drop ignore after #9.                                                                  no-warning-comments2:1   FIXME: Find this info on the page.                                                                   no-warning-comments

  source/libs/post-form.ts:9:39:3   TODO: Improve JSX types for event listeners so we can use... [clipped]                                                                   no-warning-comments

  source/features/hidden-review-comments-indicator.tsx:37:237:2   TODO: Drop some definitions when their related bugs are resolved                                                                   no-warning-comments

  source/features/revert-file.tsx:89:489:4   TODO: Drop `as` after https://github.com/microsoft/TSJS-lib-generator/issues/741                                                                   no-warning-comments
@sindresorhus
Copy link
Owner

// @lubien In case you're interested in working on this.

@sindresorhus
Copy link
Owner

I would go for the short version:

⚠ 1:1 TODO: Drop ignore after #9.

@lubien
Copy link
Contributor

lubien commented Sep 27, 2019

// @lubien In case you're interested in working on this.

I can work on this weekend, sure!

I would go for the short version:

Noted.

How long until clip? I could use something like process.stdout.columns to calculate the width and try not to overflow too much. I'd have also to count ESLint own input.

lubien@heron:~/dev$ npx eslint Untitled-1.js

~/dev/foo.js
  1:1  error  Unexpected 'todo' comment                                    unicorn/expiring-todo-comments

✖ 1 problem (1 errors, 0 warnings)

lubien@heron:~/dev$ node
> process.stdout.columns
103

Given 103 column digits. For this case I can see 4 digits for reporting level, a few for line:column (in this case just 3, but would need more). Double space separators at first then some spaces to make the rule name appear at right. 61 digits for the report message.

How about making messages at most 50% process.stdout.columns? With a fallback width in case some situation make this value not available (happened to me at least in Elixir I don't know about NodeJS).

@sindresorhus
Copy link
Owner

We can’t depend on process.stdout.columns as we can’t know how the reporter will format it. We just have to decide on an arbitrary (large) limit and truncate.

@sindresorhus
Copy link
Owner

sindresorhus commented Nov 29, 2019

I can work on this weekend, sure!

@lubien Are you still interested in working on this? No pressure at all. Just want to open this issue up for other if you're busy :)

@lubien
Copy link
Contributor

lubien commented Nov 29, 2019

@sindresorhus Interested for sure but I'm afraid my free time wont be enough for a couple weeks or so.

Sorry for delaying this but would be best if we open this issue for another person for now but I'm eager to return contributing soon anytime by December so whenever I can help please tag me.

@fregante
Copy link
Collaborator Author

fregante commented Sep 1, 2020

FYI, this was implemented and released in eslint: eslint/eslint#12327

@fisker
Copy link
Collaborator

fisker commented Sep 1, 2020

I'm updating dependencies in #816

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants