-
Notifications
You must be signed in to change notification settings - Fork 6
Add JS linting #51
Comments
+1 to the general idea. I think the benefits we'd want from automatic linting are;
If we're considering this as part of the Service Patterns work, then defining some rules gets a little more complicated/contentious, as it applies to more than just GOV.UK. Generally i'm wary on big rule discussions/bike shedding I think we should also consider http://standardjs.com - it's becoming increasingly popular, and side-steps the issue of debating linting rules. There are some established community rulesets (eg, airbnb's) we might want to look at. |
I'm a huge proponent of standard/semistandard/batteries-included and anti-bikeshedding options. As for the merits of linting, as a 3 year JSHint/JSCS/Eslint (in that order) user it's a no-brainer and I wouldn't dream to write JS today sans a linter.
JSCS AFAIK still fills in more styling convention gaps than Eslint, but if I had to personally pick between more stricter styling checks and the simplicity of just running |
Also: I've looked very briefly into adding support for
|
Yes please, linting is a great idea. Before the days of JS unit tests (for me anyway) linting saved my life many a time 👍 |
In the frontend meeting today we again discussed using standard as the default solution for linting JS. @tvararu has implemented this for the prototype kit (close to being merged) and we’re going to see how that works. If it does then potentially we might want to pick a GOV.UK application and use standard locally on that. After that I think we’d be happy to implement standard as part of govuk-lint. |
Difficulties using Standard linting in this repo described here: #63 |
This gem has been deprecated and with a move away from an "all-in-one" linting tool |
If we’re going to lint front-end SASS assets it’d be good to extend this to JS assets as well. @dsingleton partially added this in a branch a while ago but it needed further discussion and never was merged.
What are people’s thoughts as to the use of this? We’d need to define some rules (we’ve got some already) but that could be done under the purview of the Service Patterns work.
The text was updated successfully, but these errors were encountered: