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

Formatting should follow Crockford's JavaScript formatting conventions #21

Open
typerandom opened this issue Sep 14, 2016 · 0 comments
Open

Comments

@typerandom
Copy link
Contributor

typerandom commented Sep 14, 2016

Formatting should follow Crockford's JavaScript formatting conventions. This to increase readability and ease (most JS projects follow this style) when contributing to the project. Also, we should also add a .jslint-file so that these conventions are enforced.

E.g.

Jwt.prototype.isExpired = function() {
  return new Date(this.body.exp*1000) < new Date();
};

Should be formatted as:

Jwt.prototype.isExpired = function () {
  return new Date(this.body.exp * 1000) < new Date();
};

And:

if(header instanceof Error){
  return done(new JwtParseError(properties.errors.PARSE_ERROR,jwtString,null,null,header));
}

Should be formatted as:

if (header instanceof Error) {
  return done(new JwtParseError(properties.errors.PARSE_ERROR, jwtString, null, null, header));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant