[英]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.