在grunt.js中获取混合空格和制表符错误,如何删除它?

时间:2012-12-12 07:24:33

标签: gruntjs

我的jshint代码是:

 jshint: {
      options: {
        curly: true,
        eqeqeq: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        sub: true,
        undef: true,
        boss: true,
        eqnull: true,
        browser: true
      },
      globals: {
        jQuery: true
      }
    },

我称之为:

  grunt.registerTask('foo', 'lint');// For running in cmd you need grunt.cmd foo.

我怎样才能克服这个错误?

1 个答案:

答案 0 :(得分:4)

您可以修复混合标签和空格:)

或添加smarttabs选项以忽略错误:

jshint: {
  options: {
    smarttabs: true
  }
}

或者如果您只想禁用每个文件的警告,请将其添加到包含错误的文件顶部:

/*jshint smarttabs:true */

JSHint文档:http://www.jshint.com/docs/