Repository navigation
Use a code style linter #727
Copy link
Copy link
Closed
Description
Activity
@stephenplusplus I like jscs personally, has there ever been any documented conversations around general dos and don'ts?
stephenplusplus commented
on Jul 17, 2015 ContributorAuthorMore actionsLaced all throughout PRs and issues history. We should try the
--auto-configureoption: http://jscs.info/overview.html#options.--auto-configuretests your code against several pre-made style guides and tells you how many times you violate it. It looks like you can then use those style guides as a base and make adjustments if you want to turn on/off additional rules.Preset Errors Rules airbnb 224 11 crockford 4279 6 google 117 7 grunt 47 6 jquery 4815 10 mdcs 5256 8 node-style-guide 296 10 wikimedia 8401 11 wordpress 3869 11 yandex 3825 8 stephenplusplus commented
on Jul 17, 2015 ContributorAuthorMore actionsAh okay, probably want to find the closest match and make adjustments then. Here are some things:
// good function fn() {} // bad var fn = function() {}; // good aMethod(function(err) { }); // bad aMethod(function (err) { }); // good if (something) { } else if (somethingElse) { } // bad // any other way of spacing if clauses
Let me know if I can answer any "this" or "that"s!
stephenplusplus commented
on Jul 17, 2015 ContributorAuthorMore actionsI don't know if these could be covered, but:
// good var self = this; // bad var that = this; // good var self = this; aMethod(function() { self.anotherMethod(); }); // bad aMethod(function() { this.anotherMethod(); }.bind(this));
- added 2 commits that reference this issue
on Nov 11, 2022 - added a commit that references this issue
on Jan 10, 2023 - added 2 commits that reference this issue
on Feb 25, 2026 - added a commit that references this issue
on Mar 5, 2026 - added a commit that references this issue
on Mar 18, 2026 - added a commit that references this issue
on Mar 27, 2026
Metadata
Metadata
Assignees
Labels
No labels
Now that we are seeing more contributions, it would be a good time to remove the guesswork from matching our library's style rules. https://github.com/jscs-dev/node-jscs can integrate with our
npm run lintcommand, so PRs will catch any issues.@callmehiphop do you know of a better one than jscs?