6
\$\begingroup\$

Whenever someone asks a JavaScript code review question, I'm tempted to run it through JSHint and just paste the results. I realize this is not in the spirit of CR.SE, but it seems to me that anyone interested in a code review should use a linter, where one exists, and some of our askers may simply not know that lint tools exist. That should be corrected.

But when I run a question through, say, JSHint, and get dozens of easily-corrected problems, is it always appropriate to drop a link to my favorite lint tool in a comment?

\$\endgroup\$

1 Answer 1

6
\$\begingroup\$

I would say that it's ok to paste lint results in your answer provided that:

  • You explain what lint is and provide a link for the actual tool used.
  • Suggest alternatives for lint identified issues, since the point of the site is code review not code debug.

It's also ok to just leave a comment with your favourite lint tool, it would be a helpful push to the right direction. If you see obvious issues that lint could have caught and don't have time for a proper answer, a comment about lint would be the appropriate thing to do.

BTW when I read the title of the question I thought would you ask for our Stack Exchange overlords to give us auto-linting features, that would be LEGENDARY!

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .