[英]JSCS validateJSDoc Error Unsupported Rule on Closure or Comment at the Top of the File
I've setup JShint and JSCS using Gulp for an AngularJS app using the JShint and JSCS docs for options, and JSHint work as it should, but when used with JSCS I get a bunch of errors all one per file all associated to the IIFE or comment at the top of the files. 我已经使用Gulp为AngularJS应用程序使用Gulp设置了JShint和JSCS,并使用JShint和JSCS文档作为选项,并且JSHint可以正常工作,但是当与JSCS一起使用时,每个文件都与IIFE或在文件顶部添加注释。
gulp.task('vet', function () {
var files = [
'./resources/assets/js/**/*.js',
'!./resources/assets/js/services/services.httpi.js',
'./*.js'
];
return gulp.src(files)
.pipe(jscs())
.pipe(jscs.reporter())
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish', {verbose: true}));
});
But when I run the vet task I get this error for all my files: 但是,当我运行vet任务时,我的所有文件都收到此错误:
[15:15:41] Starting 'vet'...
Unsupported rule: validateJSDoc at D:\projects\app\resources\assets\js\app.config.js :
1 |(function () {
--------^
2 |
3 | 'use strict';
I've tried moving 'use strict' out of the closure (sloppy, but needed to see if it worked) 我曾尝试将“严格使用”移出封闭状态(草率,但需要查看其是否有效)
Alternatively I also tried adding a comment before the closure, but get the same error, but instead it points to the comment: 或者,我也尝试在闭包之前添加注释,但得到相同的错误,但它指向注释:
2 code style errors found.
Unsupported rule: validateJSDoc at D:\projects\app\resources\assets\js\app.module.js :
1 |/**
--------^
2 | * Application Module
3 | * @namespace Application
Are JSCS expect files to start with something specific? JSCS是否期望文件以特定的开头? Anyone know how to fix this?
有人知道怎么修这个东西吗?
Check out the available JSCS rules . 查看可用的JSCS规则 。 There's not
validateJSDoc
, only jsDoc
. 没有
validateJSDoc
,只有jsDoc
。 The reason being that validateJSDoc
was deprectated and dropped in JSCS 2.0 . 原因是
validateJSDoc
在JSCS 2.0中被弃用并丢弃 。
Either remove that rule from your .jscsrc
(or whatever config file you use) or fix it to make it compatible with the newer jsDoc
. 从您的
.jscsrc
(或您使用的任何配置文件)中删除该规则,或对其进行修复以使其与较新的jsDoc
兼容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.