简体   繁体   English

JSCS validateJSDoc错误文件顶部关闭或注释不支持的错误规则

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

相关问题 角度与resteasy-Mediatype不支持的错误 - angular with resteasy - Mediatype unsupported error 是否可以通过 JSCS/JSHint 限制 fit/fdescribe 函数? - Is it possible to restrict fit/fdescribe functions by JSCS/JSHint? 将diese用作字符,而不像yml文件中的注释 - use diese as a character, not like comment in a yml file {“ error”:“ unsupported_grant_type”}进行语音通话 - {“error”:“unsupported_grant_type”} for angular call HTTP状态415 –不支持的媒体类型错误 - HTTP Status 415 – Unsupported Media Type error AngularJS $ resource save()导致HTTP错误415(不支持的媒体类型) - AngularJS $resource save() causes HTTP Error 415 (Unsupported Media Type) AngularJS + Spring3.2 415不支持的媒体类型错误 - AngularJS + Spring3.2 415 Unsupported Media Type error Angular-jQuery:将jQuery放在单独的文件中并得到错误“无法读取未定义的属性” top” - Angular-jQuery : Putting jQuery in a separate file and getting error 'Cannot read property 'top' of undefined' Angular JS 中的错误在浏览器中将预览显示为 {{dish.comment}}? - Error in Angular JS shows the preview as {{dish.comment}} in browser? 使用Spring MVC Restcontroller和angularjs上传文件时不支持的媒体类型415 - unsupported Media type 415 for file upload with Spring mvc restcontroller and angularjs
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM