mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2025-02-25 19:52:16 +00:00
!5071 debug:JSDoc校验工具param值校验和顺序校验修复
Merge pull request !5071 from fanjiaojiao/master
This commit is contained in:
commit
80dc2b046b
@ -38,7 +38,7 @@ function isAscendingOrder(tags) {
|
||||
// 判断标签是否为官方标签
|
||||
const firstTag = isOfficialTag(tags[tagIndex].tag);
|
||||
// 非自定义标签在前或数组降序时报错
|
||||
if ((firstTag && secondIndex > 1) || firstIndex > secondIndex) {
|
||||
if ((firstTag && secondIndex > -1) || (firstIndex > secondIndex && secondIndex > -1)) {
|
||||
checkResult = false;
|
||||
break;
|
||||
}
|
||||
|
@ -214,11 +214,13 @@ function checkTagsQuantity(comment, index, errorLogs) {
|
||||
}
|
||||
}
|
||||
|
||||
let paramIndex = 0;
|
||||
let throwsIndex = 0;
|
||||
|
||||
function checkTagValue(tag, index, node, fileName, errorLogs) {
|
||||
const { JsDocValueChecker } = require('./check_jsdoc_value/check_rest_value');
|
||||
const checker = JsDocValueChecker[tag.tag];
|
||||
let paramIndex = 0;
|
||||
let throwsIndex = 0;
|
||||
|
||||
if (checker) {
|
||||
let valueCheckResult;
|
||||
if (tag.tag === 'param' && [ts.SyntaxKind.FunctionDeclaration, ts.SyntaxKind.MethodSignature,
|
||||
@ -261,6 +263,8 @@ function checkJsDocOfCurrentNode(node, sourcefile, permissionConfigPath, fileNam
|
||||
}
|
||||
checkTagValue(tag, index, node, fileName, errorLogs)
|
||||
});
|
||||
paramIndex = 0;
|
||||
throwsIndex = 0;
|
||||
// 标签数量校验
|
||||
checkTagsQuantity(comment, index, errorLogs);
|
||||
checkInfoMap[index.toString()].illegalTags = checkInfoMap[index.toString()].illegalTags.concat(errorLogs);
|
||||
|
Loading…
x
Reference in New Issue
Block a user