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

Warning comments are allowed without warning #3

Closed
ianwremmel opened this issue Dec 1, 2017 · 7 comments
Closed

Warning comments are allowed without warning #3

ianwremmel opened this issue Dec 1, 2017 · 7 comments

Comments

@ianwremmel
Copy link
Contributor

Generally, I'm a fan of setting no-warning-comments: error since they get lost really easily and never acted upon. Historically, we've had no-warning-comments: warn in place since there are already so many in the code base. At a minimum, I'd like to up that to warn and, ideally, error.

@adamweeks
Copy link
Collaborator

https://eslint.org/docs/rules/no-warning-comments

I'm good with them being an error and just disabling the linting specifically for a TODO that needs to go into the project.

@ianwremmel
Copy link
Contributor Author

yea. i'm partial to error myself. I'd also love to get this thing wired up, but last time I tried it got weird with our jenkins flow.

@bzang
Copy link
Contributor

bzang commented Dec 1, 2017

What if we only allow a select few specific comments? If it's only a select set, it maybe less likely to get lost.

I actually do find TODOs useful. Having to add a eslint-disable for every TODO seems much. This gets to be a bit much for projects that have precommit hooks that lint. IMO it's reasonable to have a TODO while I'm working on a feature. Maybe some sort of enforcement on PR merge? Is that possible?

@ianwremmel
Copy link
Contributor Author

yea, agreed. maybe we put the general rule at warn, but then change all all our projects to maybe have a .eslinrc.js that conditionally sets it to error when CI is true?

@adamweeks
Copy link
Collaborator

I don't think eslint-disable-next-line is unreasonable. I put FIXME and TODO in the code to remind myself of something to do before merging.

Just checked and in all of the widgets we only have one instance of TODO.

@bzang
Copy link
Contributor

bzang commented Dec 1, 2017

I don't use TODO because it errors/warns me not to... also I'm OCD and the squiggly lines drive me insane. I like @ianwremmel's idea of doing warn and then switching to error so that it doesn't make it into master.

@ianwremmel
Copy link
Contributor Author

@bzang. yea. most of the comments in here are why i've had them set to warn. It's enough to remind me to do stuff, but I can still commit while working on a PR. I'll put together a PR for moving from nothing to warn and we can add back log item for stricter enforcement (since that'll also require removing all the existing TODO/FIXME comments currently in the code bases)

@bzang bzang closed this as completed in 550da97 Dec 4, 2017
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

No branches or pull requests

3 participants