diff --git a/build-tools/dts_parser/src/coreImpl/checker/src/tag_legality_check.ts b/build-tools/dts_parser/src/coreImpl/checker/src/tag_legality_check.ts index 582937225cb6361afeec573bdfe993befe6d3761..805143a3c0a3d4523f7984caed474925d0cebf66 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/src/tag_legality_check.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/src/tag_legality_check.ts @@ -64,13 +64,17 @@ export class LegalityCheck { apiLegalityTagsSet.delete('param'); if (apiLegalityTagsSet.has(apiTag.tag)) { apiLegalityTagsSet.delete(apiTag.tag); - if (singleApi.getApiType() === ApiType.INTERFACE) { - apiLegalityTagsSet.delete('typedef'); - } + } + if (singleApi.getApiType() === ApiType.INTERFACE && (apiTag.tag === 'typedef' || apiTag.tag === 'interface')) { + apiLegalityTagsSet.delete('typedef'); + apiLegalityTagsSet.delete('interface'); } if (singleApi.getApiType() === ApiType.METHOD && (singleApi as MethodInfo).getReturnValue().length === 0) { apiLegalityTagsSet.delete('returns'); } + if (apiLegalityTagsSet.has('extends') && (singleApi as ClassInfo).getParentClasses().length === 0) { + apiLegalityTagsSet.delete('extends'); + } }); // param合法性单独进行校验 LegalityCheck.paramLegalityCheck(paramTagNumber, paramApiNumber, apiLegalityCheckResult); diff --git a/build-tools/dts_parser/src/coreImpl/checker/src/tag_value_check.ts b/build-tools/dts_parser/src/coreImpl/checker/src/tag_value_check.ts index b326bb9f364f52e899c848ca8761031ca6472e4a..513c18f799f32609bef34fddef8c8f8dde367dd5 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/src/tag_value_check.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/src/tag_value_check.ts @@ -312,7 +312,7 @@ export class TagValueCheck { const isNumber: boolean = /^\d+$/.test(deprecatedVersion); if (deprecatedFixedField !== 'since' || !isNumber) { deprecatedValueCheckResult.state = false; - deprecatedValueCheckResult.errorInfo = ErrorMessage.ERROR_INFO_VALUE_DEFAULT; + deprecatedValueCheckResult.errorInfo = ErrorMessage.ERROR_INFO_VALUE_DEPRECATED; } return deprecatedValueCheckResult; } diff --git a/build-tools/dts_parser/src/typedef/checker/result_type.ts b/build-tools/dts_parser/src/typedef/checker/result_type.ts index 02f0468f99299943352de866b9ae404908214cc1..9eebb28b2bc3af7cc289292ca1e3421583692943 100644 --- a/build-tools/dts_parser/src/typedef/checker/result_type.ts +++ b/build-tools/dts_parser/src/typedef/checker/result_type.ts @@ -117,7 +117,7 @@ export enum ErrorMessage { ERROR_EVENT_CALLBACK_MISSING = 'The off functions of one single event should have at least one callback parameter, and the callback parameter should be the last parameter.', ERROR_EVENT_ON_AND_OFF_PAIR = 'The on and off event subscription methods do not appear in pair.', ERROR_EVENT_WITHOUT_PARAMETER = 'The event subscription methods should has at least one parameter.', - ILLEGAL_USE_ANY = 'Illegal [any] keyword used in the API', + ILLEGAL_USE_ANY = 'Illegal [$$] keyword used in the API', ERROR_CHANGES_VERSION = 'Please check if the changed API version number is 10.', ERROR_WORD = 'The current word [$$] is incompatible with the regulaion, please confirm whether it needs to be corrected to a common word.', ERROR_NAMING = 'Prohibited word in [$$]:{$$}.The word allowed is [$$]',