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

Source Alignment #2

Open
AlgoTrader opened this issue Jun 5, 2012 · 1 comment
Open

Source Alignment #2

AlgoTrader opened this issue Jun 5, 2012 · 1 comment

Comments

@AlgoTrader
Copy link

Source misalignment makes code very difficult to read. this.text starts at ident level but finishes at position 0 and rest of module is misaligned. There is online JS beautifier http://jsbeautifier.org/ although I prefer Eclipse formatting

  this.text = function(content) {
    content = strval(content);
    if (!tags && !comment && !pi && !cdata) return this;
    if (attributes && attribute) {
      ++texts;
      write(content.replace(/&/g, '&').replace(/"/g, '"'));
      return this;
    }
    else if(attributes && !attribute) {
      this.endAttributes();
    }
    ++texts;
    write(content.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'));
  return this;
}
@touv
Copy link
Collaborator

touv commented Jun 5, 2012

Generally, I use jshint - http://www.jshint.com/ to check my code. I integrated it in my vim configuration with the Syntastic plugin - https://github.com/scrooloose/syntastic. But sometimes, I forget to follow its recommendations ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants