Add some accommodation for more style options #10

Merged
merged 2 commits into from Feb 17, 2012

Conversation

Projects
None yet
2 participants
Contributor

joshwilsdon commented Feb 16, 2012

This adds:

  • strict-indent option which forces indenting to be a multiple of indent (ie. indent=4, indents cannot be 7)

  • continuation-at-front which allows for continuations to start at the front of the line instead of being at the end:

    if (...
    && ...
    || ...
    + ...) {

  • leading-right-paren-ok which allows a line to start with: )

It also fixes an issue where an object has a member named 'delete' and you want to call obj.delete which was previously breaking on the space after keyword check.

joshwilsdon added some commits Feb 15, 2012

@joshwilsdon joshwilsdon This adds the options: continuation-at-front, right-paren-ok, fixes s…
…paced indents and allows things like VM.delete().

continuation-at-front allows:

    if (... &&
        ...) {

to be written as:

    if (...
        && ...) {

instead.  It does this for ||, && and + generating a warning if you do the other way.

right-paren-ok allows:

     callFunction(...,
         function() {
             ...
         }
     );

which without this option errors as the line starts with a ).
1e31a02
@joshwilsdon joshwilsdon Add README entries for new options, rename right-parent-ok to leading…
…-right-paren-ok, add strict-indent option fix issue with keyword parens pointed out by trentm.
036ed17

davepacheco merged commit 485da03 into davepacheco:master Feb 17, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment