简体   繁体   English

jslint 是否有缩进选项或已被删除?

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

The indent option appears to not be recognized any more.缩进选项似乎不再被识别。

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

Is this still an option for jslint or has it been removed?这仍然是 jslint 的一个选项还是已被删除?

I've tried setting it using the web interface here , in multiple syntaxes, but I keep getting an error.我尝试在此处使用 web 接口以多种语法对其进行设置,但我一直收到错误消息。

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.github上的更改日志似乎很小,并没有提及。

EDIT: jslint recently added 2-space indent support with directive /*jslint indent2*/编辑: jslint最近使用指令/*jslint indent2*/添加了 2-space 缩进支持

i'm a jslint maintainer.我是jslint维护者。 toyed with a patch reintroducing directive /*jslint indent2*/ to make jslint more accessible to projects already using 2-space indents here .玩弄了一个补丁重新引入指令/*jslint indent2*/以使 jslint 更容易被已经使用 2-space indents here的项目访问。

you can post a feature-request for it @ https://github.com/jslint-org/jslint/issues to speed up the process.您可以为它发布功能请求@ https://github.com/jslint-org/jslint/issues以加快进程。

latest jslint has the following directives:最新的 jslint 具有以下指令:

// 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.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM