News for hackers. Stuff that matters.
Re:A set of best practices for JavaScript projects by ganonm on Wednesday July 05, 2017 @06:07AM (#14701149)
This is misleading advice. Most linters can be configured to fail upon detecting a 'TODO'.

I make liberal use of TODOs when developing, typically for reminding myself to e.g. localize a string I've hardcoded during prototyping or to refactor kludgy code.

A pre commit git hook gets triggered to run the linter when I attempt to commit which helps avoid the possibility of adding code containing 'TODOs'. Obviously I can just add the '-n' flag to not trigger hooks, but this requires intention.

In short, using TODOs appropriately is a massive boost to productivity and the alternative is either to just do those random tasks that pop into your head during the course of writing code or to just hope that you remember to do it later.

Re:A set of best practices for JavaScript projects by dav on Wednesday July 05, 2017 @09:12AM (#14702095)
Combine the two: I always leave a link to a ticket with my TODOs. An improvement would be to also use a commit hook or linter to enforce it.
Re:A set of best practices for JavaScript projects by vahidpg on Wednesday July 05, 2017 @09:45AM (#14702319)
I think combining the two is the best. I will edit that, thanks for your feedback.
Re:A set of best practices for JavaScript projects by Cub3 on Wednesday July 05, 2017 @07:25PM (#14706995)
I generally do a TODO with a date written then use a tool to scan for them and rank by date
Re:A set of best practices for JavaScript projects by lomnakkus on Wednesday July 05, 2017 @09:10AM (#14702083)
I don't think anybody's saying not to do it before merging. (How would anyone even tell?)

> A pre commit git hook gets triggered to run the linter[...]

Git hooks actually need to be set up to work, so this incurs overhead for onboarding.

Re:A set of best practices for JavaScript projects by yes_or_gnome on Wednesday July 05, 2017 @12:10PM (#14703614)
This is one reason why I find GitHub (especially, Enterprise) so frustrating. I want simple server-side githooks to verify that client-side hooks were used (or, at least a good forgery). I don't want to setup an additional CI environment just to run the most basic SED commands. Nor do I want to make my existing CI environment more complicated by merging disparate validations; unit test validation and commit validations.
Re:A set of best practices for JavaScript projects by dav on Wednesday July 05, 2017 @09:14AM (#14702112)
I built a simple system for some of our repos that fails the build if you don't have the shared team git hooks set up properly, and on failure directs the new engineers on how to fix the situation.
Re:A set of best practices for JavaScript projects by swsieber on Wednesday July 05, 2017 @09:33AM (#14702231)
And really, one should just set up the hooks automatically when the build script is run, if you really want to reduce friction.
Re:A set of best practices for JavaScript projects by lomnakkus on Friday July 07, 2017 @06:45PM (#14722815)
A great idea, but this also takes time, albeit once rather than N times. Any chance you could share some of the scripts (etc.)?