Don't indent "use strict" #167

Closed
drewhamlett opened this Issue Dec 27, 2012 · 0 comments

Comments

Projects
None yet
2 participants

In 'jslint node true' mode you can put "use strict" at the top of file. Current jsbeautifyjs will indent this like so

/*jslint node: true, vars: true, plusplus: true, devel: true, nomen: true */
    "use strict";

JSLint will now complain that use strict is in the wrong column.

expected would be this

/*jslint node: true, vars: true, plusplus: true, devel: true, nomen: true */
"use strict";

This is what I"ve changed to jsbeautify so it won't do this.

 case 'TK_STRING':
            if (last_type === 'TK_INLINE_COMMENT' && (token_text === '"use strict"' || token_text === "'use strict'")) {
                print_token();
                break;
            }

This could be written a lot better, but I just wanted to show it as an example.

@einars einars closed this in 8daa7c7 Dec 27, 2012

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