[英]enforce 2 space indentation with jshint
我有一个使用此配置的.jshintrc文件:
{
"indent": 2
}
我有一个js文件,看起来像这样:
var hello = angular.module('hello', ['hello.controllers']);
angular.module('hello.controllers', []).
controller('MainCtrl', ['$scope', function ($scope) {
'use strict';
// hello msg
var helloMsg = 'Some Awesome Things';
$scope.helloMsg = helloMsg;
}]);
当我在文件上运行jshint时,不会引发任何错误。
注意,行var helloMsg = 'Some Awesome Things';
缩进两个额外的空格。
我需要怎么做才能使jshint在上面的代码上引发错误?
您是否正在使用版本> = 2.5.0? 如果是这样,似乎他们将其删除了:
缩进不再提供有关缩进级别的警告
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.