gpt4 book ai didi

javascript - 不支持的 jsdoc 规则修复

转载 作者:数据小太阳 更新时间:2023-10-29 05:12:07 26 4
gpt4 key购买 nike

使用 .jsrc 文件时,我的服务器/前端文件出现以下错误。它在我的文件顶部抛出一个错误。我该如何抑制它?

Unsupported rule: fix at js/server.js :
1 |'use strict';

Unsupported rule: fix at js/example.js :
1 |(function() {

这是我的.jscsrc文件

  // http://jscs.info/rules.html
{
"requireOperatorBeforeLineBreak": true,
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
"maximumLineLength": {
"value": 100,
"allowComments": true,
"allowRegex": true
},
"validateIndentation": 2,
"validateQuoteMarks": { "mark": "'", "escape": true },

"disallowMultipleLineStrings": true,
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowKeywordsOnNewLine": ["else"],

"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"return",
"try",
"catch"
],
"requireSpaceBeforeBinaryOperators": [
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
"&=", "|=", "^=", "+=",

"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
"|", "^", "&&", "||", "===", "==", ">=",
"<=", "<", ">", "!=", "!=="
],
"requireSpaceAfterBinaryOperators": true,
"requireSpacesInConditionalExpression": true,
"requireSpaceBeforeBlockStatements": true,
"requireSpacesInForStatement": true,
"requireLineFeedAtFileEnd": true,
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"disallowSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideArrayBrackets": "all",
"disallowSpacesInsideParentheses": true,
"disallowMultipleLineBreaks": true,
"disallowNewlineBeforeBlockStatements": true
}

最佳答案

在 .jscsrc 中添加以下检查将消除您的错误:

"jsDoc": {
"checkParamNames": true,
"requireParamTypes": true
}

“validateJSDoc”已被删除;请参阅访问以下网址

访问了解更多信息http://jscs.info/rule/jsDoc.html

拉取请求 https://github.com/roots/sage/pull/1522

提交 SHA https://github.com/chrisk2020/sage/commit/bcefb5908fdb457d2126833198cd760378ffe949

关于javascript - 不支持的 jsdoc 规则修复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32104259/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com