73rhodes / Sublime-JSLint

JSLint for Sublime Text 2 and 3.
80 stars 14 forks source link

How to config indent size? #47

Closed hoangnguyencong closed 8 years ago

truh commented 8 years ago

You can put a config file called .jslintrc into your home directory.

{
    "indent": 2
}

edit: you can also specify this option in the plugin options.

For some reason the JSLint version shipped with this plugin ignore the config file so you have to use your own version of JSLint and you also will have to change the jslint command in the plugin settings.

A different approach is to put a comment like /*jslint indent: 2*/ into your js files.

MarcosRava commented 8 years ago

1 Bad option 'indent'.

/*jslint node: true, indent: 2 */ // Line 1, Pos 1

2 Unexpected expression 'use strict' in statement position.

"use strict"; // Line 2, Pos 1
73rhodes commented 8 years ago

JSLint no longer supports an option for indentation. Please log an issue against JSLint if you require it. Note that Sublime-JSLint allows you to use any version of JSLint you want to. Just change your config settings to point to it on your file system.

donnykurnia commented 8 years ago

The 2015-10-08 jslint.js now hardcoded 4 margin and no longer accept indent option.

73rhodes commented 8 years ago

refer to https://github.com/douglascrockford/JSLint/commit/f819cf3c65d07086cf217c549c577fa77dc65fc9#commitcomment-14603692

hoangnguyencong commented 8 years ago

@jklepp-tgm, @MarcosRava ,@donnykurnia, @73rhodes thank for your feedbacks :+1: