Is there an indent option for jslint or has it been removed?

144 Views Asked by At

The indent option appears to not be recognized any more.

http://linterrors.com/js/option-indent

Is this still an option for jslint or has it been removed?

I've tried setting it using the web interface here, in multiple syntaxes, but I keep getting an error.

Bad option 'indent'.

/*jslint
    bitwise,
    browser:true,
    indent: 2
*/

function test () {
  const test = "hello SO";
}

Research:

The changelog on github seems pretty small and does not mention it.

1

There are 1 best solutions below

0
kai zhu On

EDIT: jslint recently added 2-space indent support with directive /*jslint indent2*/

i'm a jslint maintainer. toyed with a patch reintroducing directive /*jslint indent2*/ to make jslint more accessible to projects already using 2-space indents here.

you can post a feature-request for it @ https://github.com/jslint-org/jslint/issues to speed up the process.

latest jslint has the following directives:

// Optional directives.
// .... /*jslint beta*/ .......... Enable experimental features.
// .... /*jslint bitwise*/ ....... Allow bitwise operators.
// .... /*jslint browser*/ ....... Assume browser environment.
// .... /*jslint convert*/ ....... Allow conversion operators.
// .... /*jslint couch*/ ......... Assume CouchDb environment.
// .... /*jslint debug*/ ......... Include jslint stack-trace in warnings.
// .... /*jslint devel*/ ......... Allow console.log() and friends.
// .... /*jslint eval*/ .......... Allow eval().
// .... /*jslint for*/ ........... Allow for-statement.
// .... /*jslint getset*/ ........ Allow get() and set().
// .... /*jslint long*/ .......... Allow long-lines.
// .... /*jslint name*/ .......... Allow weird property-names.
// .... /*jslint node*/ .......... Assume Node.js environment.
// .... /*jslint single*/ ........ Allow single-quote strings.
// .... /*jslint test_internal_error*/ ... Test jslint's internal-error
// ........................................... handling-ability.
// .... /*jslint this*/ .......... Allow 'this'.
// .... /*jslint unordered*/ ..... Allow unordered cases, params, properties.
// .... /*jslint variable*/ ...... Allow unordered const and let declarations
// ................................... that are not at top of function-scope.
// .... /*jslint white: true...... Allow messy whitespace.