diff --git a/compiler/test/error.json b/compiler/test/error.json index ef93f629c..e25c3a114 100644 --- a/compiler/test/error.json +++ b/compiler/test/error.json @@ -31,18 +31,14 @@ { "message": "Then statement cannot be null in if statement.", "type": "ERROR" - }, - { - "message": "'' does not meet UI component syntax.", - "type": "ERROR" } ], "idCheck": { - "message": "The current component id \"1\" is duplicate with ${const path = require('path');path.resolve(__dirname, '../../../test/transform_ut/application/entry/src/main/ets/pages/utForValidate/Decorators/process_component_build/idCheck.ets')}:6:21.", + "message": "The current component id \"1\" is duplicate with ${path.resolve(__dirname, '../idCheck.ets')}:7:21.", "type": "WARN" }, "arkUIStandard": { - "message": "'Text('Hello').onClick' does not meet UI component syntax.", + "message": "'Text('Hello').onCilck' does not meet UI component syntax.", "type": "ERROR" }, "stateStyles": { @@ -54,7 +50,7 @@ "type": "ERROR" }, "attributeCheck": { - "message": "'ForEach(this.arr, () =>{}, (item: string) => item).h' does not meet UI component syntax.", + "message": "'ForEach(this.arr, () =>{}, this.arr[0]).h' does not meet UI component syntax.", "type": "ERROR" }, "validateDecorators": { @@ -74,7 +70,7 @@ "type": "ERROR" }, "validateBuildMethodCount": { - "message": "struct 'ValidateBuildMethodCountIndex' must be at least or at most one 'build' method.Solutions:>A structurally modified page must have at least one and no more than one'build' method.", + "message": "struct 'Index' must be at least or at most one 'build' method.Solutions:>A structurally modified page must have at least one and no more than one'build' method.", "type": "ERROR" }, "validateHasController": { @@ -82,7 +78,7 @@ "type": "ERROR" }, "processWatch": { - "message": "Cannot find name 'onWatch' in struct 'ProcessWatchIndex'.", + "message": "Cannot find name 'onWatch' in struct 'Index'.", "type": "ERROR" }, "updateBuilderParamProperty": { @@ -110,7 +106,7 @@ "type": "ERROR" }, "validateHasIllegalDecoratorInEntry": { - "message": "The @Entry component 'ValidateHasIllegalDecoratorInEntryIndex' cannot have the @Prop property 'message'.", + "message": "The @Entry component 'Index' cannot have the @Prop property 'message'.", "type": "WARN" }, "validateHasIllegalQuestionToken": { @@ -142,11 +138,11 @@ "type": "WARN" }, "validateForbiddenToInitViaParam": { - "message": "Property 'message' in the custom component 'ValidateForbiddenToInitViaParamChild' cannot be initialized here (forbidden to specify).", + "message": "Property 'message' in the custom component 'Child' cannot be initialized here (forbidden to specify).", "type": "ERROR" }, "validateMandatoryToInitViaParam": { - "message": "Property 'message' in the custom component 'ValidateMandatoryToInitViaParamChild' is missing (mandatory to specify).", + "message": "Property 'message' in the custom component 'Child' is missing (mandatory to specify).", "type": "ERROR" }, "validateInitDecorator": [ @@ -183,16 +179,10 @@ "message": "The module name 'Button' can not be the same as the inner component name.", "type": "ERROR" }, - "notComponent": [ - { - "message": "Decorator '@Component', '@ComponentV2', or '@CustomDialog' is missing for struct 'EntryComponent'.", - "type": "ERROR" - }, - { - "message": "A page configured in 'main_pages.json or build-profile.json5' must have one and only one '@Entry' decorator.Solutions:>Please make sure that the splash page has one and only one '@Entry' decorator.", - "type": "ERROR" - } - ], + "notComponent": { + "message": "Decorator '@Component', '@ComponentV2', or '@CustomDialog' is missing for struct 'EntryComponent'.", + "type": "ERROR" + }, "notConcurrent": { "message": "The struct 'NotConcurrentIndexDecorator' use invalid decorator.", "type": "WARN" @@ -285,18 +275,12 @@ "message": "A page can contain at most 10 '@Preview' decorators.", "type": "ERROR" }, - "ExceededEntry": [ - { - "message": "A page can't contain more than one '@Entry' decorator", - "type": "ERROR" - }, - { - "message": "A page configured in 'main_pages.json or build-profile.json5' must have one and only one '@Entry' decorator.Solutions:>Please make sure that the splash page has one and only one '@Entry' decorator.", - "type": "ERROR" - } - ], + "ExceededEntry": { + "message": "A page can't contain more than one '@Entry' decorator", + "type": "ERROR" + }, "OneEntry": { - "message": "A page configured in 'main_pages.json or build-profile.json5' must have one and only one '@Entry' decorator.Solutions:>Please make sure that the splash page has one and only one '@Entry' decorator.", + "message": "A page configured in 'undefined or build-profile.json5' must have one and only one '@Entry' decorator.Solutions:>Please make sure that the splash page has one and only one '@Entry' decorator.", "type": "ERROR" }, "notMethodDeco": { @@ -797,216 +781,8 @@ "type": "ERROR" } ], - "v1ToV2Component": [ - { - "message": "Property 'func_value1' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'func_value2' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", - "type": "ERROR" - } - ], - "v1ToV2ComponentValidate": [ - { - "message": "The type of the @Param property can not be a class decorated with @Observed.", - "type": "ERROR" - }, - { - "message": "Property 'param_value' in the @ComponentV2 component 'TestV2Child2' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'param_value_alias_type' in the @ComponentV2 component 'TestV2Child2' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'state_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'prop_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'link_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'provide_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'consume_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'objectLink_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'storage_link_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'storage_prop_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'local_storage_link_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'local_storage_prop_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", - "type": "ERROR" - } - ], - "v2ToV1ComponentValidate": [ - { - "message": "The type of the @Provider property can not be a class decorated with @Observed.", - "type": "ERROR" - }, - { - "message": "The @ComponentV2 struct must not contain any @Component with an @Link decorated variable", - "type": "ERROR" - }, - { - "message": "Property 'set_value' in the @Component component 'TestV1Child1' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'set_value_alias' in the @Component component 'TestV1Child1' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "The @ComponentV2 struct must not contain any @Component with an @Link decorated variable", - "type": "ERROR" - }, - { - "message": "Property 'set_value' in the @Component component 'TestV1Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'map_value' in the @Component component 'TestV1Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'arr_value' in the @Component component 'TestV1Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'arr_value1' in the @Component component 'TestV1Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'arr_value2' in the @Component component 'TestV1Child' are not allowed to be assigned values here.", - "type": "ERROR" - }, - { - "message": "Property 'arr_value3' in the @Component component 'TestV1Child' are not allowed to be assigned values here.", - "type": "ERROR" - } - ], - "property_observe_validate": [ - { - "message": "The type of the @State property can not be a class decorated with @ObservedV2.", - "type": "ERROR" - }, - { - "message": "The type of the @State property can not be a class decorated with @ObservedV2.", - "type": "ERROR" - }, - { - "message": "The type of the @State property can not be a class decorated with @ObservedV2.", - "type": "ERROR" - }, - { - "message": "The type of the @State property can not be a class decorated with @ObservedV2.", - "type": "ERROR" - }, - { - "message": "The type of the @State property can not be a class decorated with @ObservedV2.", - "type": "ERROR" - }, - { - "message": "The type of the @Prop property can not be a class decorated with @ObservedV2.", - "type": "ERROR" - }, - { - "message": "The type of the @Link property can not be a class decorated with @ObservedV2.", - "type": "ERROR" - }, - { - "message": "The type of the @Provide property can not be a class decorated with @ObservedV2.", - "type": "ERROR" - }, - { - "message": "The type of the @Consume property can not be a class decorated with @ObservedV2.", - "type": "ERROR" - }, - { - "message": "The type of the @StorageLink property can not be a class decorated with @ObservedV2.", - "type": "ERROR" - }, - { - "message": "The type of the @StorageProp property can not be a class decorated with @ObservedV2.", - "type": "ERROR" - }, - { - "message": "The type of the @LocalStorageLink property can not be a class decorated with @ObservedV2.", - "type": "ERROR" - }, - { - "message": "The type of the @LocalStorageProp property can not be a class decorated with @ObservedV2.", - "type": "ERROR" - }, - { - "message": "The type of the @Local property can not be a class decorated with @Observed.", - "type": "ERROR" - }, - { - "message": "The type of the @Local property can not be a class decorated with @Observed.", - "type": "ERROR" - }, - { - "message": "The type of the @Local property can not be a class decorated with @Observed.", - "type": "ERROR" - }, - { - "message": "The type of the @Local property can not be a class decorated with @Observed.", - "type": "ERROR" - }, - { - "message": "The type of the @Local property can not be a class decorated with @Observed.", - "type": "ERROR" - }, - { - "message": "The type of the @Local property can not be a class decorated with @Observed.", - "type": "ERROR" - }, - { - "message": "The type of the @Param property can not be a class decorated with @Observed.", - "type": "ERROR" - }, - { - "message": "The type of the @Param property can not be a class decorated with @Observed.", - "type": "ERROR" - }, - { - "message": "The type of the @Param property can not be a class decorated with @Observed.", - "type": "ERROR" - }, - { - "message": "The type of the @Event property can not be a class decorated with @Observed.", - "type": "ERROR" - }, - { - "message": "The type of the @Provider property can not be a class decorated with @Observed.", - "type": "ERROR" - }, - { - "message": "The type of the @Consumer property can not be a class decorated with @Observed.", - "type": "ERROR" - } - ] + "v1ToV2Component.ts": [], + "v1ToV2ComponentValidate": [], + "v2ToV1ComponentValidate": [], + "property_observe_validate": [] } \ No newline at end of file diff --git a/compiler/test/transform_ut/ut.test.ts b/compiler/test/transform_ut/ut.test.ts index 196e28071..0159175bf 100644 --- a/compiler/test/transform_ut/ut.test.ts +++ b/compiler/test/transform_ut/ut.test.ts @@ -5,7 +5,7 @@ import sinon from 'sinon'; import { expect } from 'chai'; import { - BUILD_ON, + BUILD_ON, } from '../../lib/pre_define'; import { resetComponentCollection, diff --git a/compiler/test/transform_ut/ut_partial_update.test.ts b/compiler/test/transform_ut/ut_partial_update.test.ts index c54f39273..6c5dc7ebe 100644 --- a/compiler/test/transform_ut/ut_partial_update.test.ts +++ b/compiler/test/transform_ut/ut_partial_update.test.ts @@ -5,19 +5,19 @@ import sinon from 'sinon'; import { expect } from 'chai'; import { - BUILD_ON + BUILD_ON } from '../../lib/pre_define'; import { resetComponentCollection, - componentCollection + componentCollection } from '../../lib/validate_ui_syntax'; import { transformLog } from '../../lib/process_ui_syntax'; import { - componentInfo, - resetUtils, - storedFileInfo + componentInfo, + resetUtils, + storedFileInfo } from '../../lib/utils'; import { partialUpdateConfig, @@ -140,8 +140,6 @@ mocha.describe('test UT for partial update testcases [non-preview mode]', functi transform(sourceReplace(sourceCode), sourceFilePath) .then(res => { - // console.error(`1-${index}: result: `, res.code); - expect(parseCode(res.code)).eql(parseCode(targetCode)); done(); }) diff --git a/compiler/test/transform_ut/ut_validate.test.ts b/compiler/test/transform_ut/ut_validate.test.ts index 244f7d5b7..2f5bd2893 100644 --- a/compiler/test/transform_ut/ut_validate.test.ts +++ b/compiler/test/transform_ut/ut_validate.test.ts @@ -63,7 +63,7 @@ const PROJECT_ROOT: string = path.resolve(__dirname, '../../test/transform_ut'); const DEFAULT_PROJECT: string = 'application'; const TEST_CASES_PATH: string = path.resolve(PROJECT_ROOT, DEFAULT_PROJECT, 'entry/src/main/ets/pages'); const SYS_CONFIG_PATH: string = path.resolve(PROJECT_ROOT, DEFAULT_PROJECT, 'entry/src/main/ets/test/common'); -const ERROR_COLLECTION_PATH: string = path.resolve(__dirname, '../../test/error.json'); +const ERROR_COLLECTION_PATH: string = path.resolve(__dirname, '../../test/transform_ut_error.json'); const MAIN_PAGES: string[] = [ ...UT_VALIDATE_PAGES, ...UT_VALIDATE_PAGES_PREVIEW, @@ -199,32 +199,16 @@ mocha.describe('test UT for validate testcases [non-preview mode]', function () const warnMsgs: string[] = logger.getWarnMsgs(); const infoMsgs: string[] = logger.getInfoMsgs(); - // console.error(`1-${index}: errorMsgs: `, JSON.stringify(errorMsgs)); - // console.error(`1-${index}: expectErrorMsgs: `, JSON.stringify(expectErrorMsgs)); - - // console.error(`1-${index}: errorMsgs.length: ${errorMsgs.length}, expectErrorMsgs.length: ${expectErrorMsgs.length}`); - // console.error(`1-${index}: warnMsgs.length: ${warnMsgs.length}, expectWarnMsgs.length: ${expectWarnMsgs.length}`); - expect(errorMsgs.length === expectErrorMsgs.length).to.be.true; expect(warnMsgs.length === expectWarnMsgs.length).to.be.true; - // console.error(`1-${index}: errorMsgs: `, JSON.stringify(errorMsgs)); - // console.error(`1-${index}: warnMsgs: `, JSON.stringify(warnMsgs)); - // console.error(`1-${index}: infoMsgs: `, JSON.stringify(infoMsgs)); - errorMsgs.forEach((err) => { const logInfo: string = parseLog(err); - - // console.error(`1-${index}: logInfo: `, logInfo); - // console.error(`1-${index}: expectErrorMsgs: `, JSON.stringify(expectErrorMsgs)); expect(expectErrorMsgs.includes(logInfo)).to.be.true; }); warnMsgs.forEach((err) => { const logInfo: string = parseLog(err); - - // console.error(`1-${index}: logInfo: `, logInfo); - // console.error(`1-${index}: expectWarnMsgs: `, JSON.stringify(expectWarnMsgs)); expect(expectWarnMsgs.includes(logInfo)).to.be.true; }); diff --git a/compiler/test/transform_ut_error.json b/compiler/test/transform_ut_error.json new file mode 100644 index 000000000..ef93f629c --- /dev/null +++ b/compiler/test/transform_ut_error.json @@ -0,0 +1,1012 @@ +{ + "@linkInitialize": { + "message": "The @Link property 'link' cannot be specified a default value.Solutions:>Please initialize the rules according to the decorator.", + "type": "ERROR" + }, + "@objectLinkInitialize": { + "message": "The @ObjectLink property 'objectLink' cannot be specified a default value.Solutions:>Please initialize the rules according to the decorator.", + "type": "ERROR" + }, + "rootContainerCheck": { + "message": "There should have a root container component.", + "type": "ERROR" + }, + "arkUIComponent": { + "message": "Only UI component syntax can be written in build method.", + "type": "ERROR" + }, + "@BuilderParam": { + "message": "In the trailing lambda case, 'CustomContainer' must have one and only one property decorated with @BuilderParam, and its @BuilderParam expects no parameter.", + "type": "ERROR" + }, + "forEachParamCheck": { + "message": "There should be wrapped in curly braces in ForEach.", + "type": "ERROR" + }, + "ifComponent": [ + { + "message": "Condition expression cannot be null in if statement.", + "type": "ERROR" + }, + { + "message": "Then statement cannot be null in if statement.", + "type": "ERROR" + }, + { + "message": "'' does not meet UI component syntax.", + "type": "ERROR" + } + ], + "idCheck": { + "message": "The current component id \"1\" is duplicate with ${const path = require('path');path.resolve(__dirname, '../../../test/transform_ut/application/entry/src/main/ets/pages/utForValidate/Decorators/process_component_build/idCheck.ets')}:6:21.", + "type": "WARN" + }, + "arkUIStandard": { + "message": "'Text('Hello').onClick' does not meet UI component syntax.", + "type": "ERROR" + }, + "stateStyles": { + "message": ".stateStyles doesn't conform standard.", + "type": "ERROR" + }, + "buttonCheck": { + "message": "The Button component with a label parameter can not have any child.", + "type": "ERROR" + }, + "attributeCheck": { + "message": "'ForEach(this.arr, () =>{}, (item: string) => item).h' does not meet UI component syntax.", + "type": "ERROR" + }, + "validateDecorators": { + "message": "The static variable of struct cannot be used together with built-in decorators.", + "type": "ERROR" + }, + "processComponentMethod": { + "message": "The 'build' method can not have arguments.", + "type": "ERROR" + }, + "@StylesParamChack": { + "message": "@Styles can't have parameters.", + "type": "ERROR" + }, + "updateHeritageClauses": { + "message": "The struct component is not allowed to extends other class or implements other interface.", + "type": "ERROR" + }, + "validateBuildMethodCount": { + "message": "struct 'ValidateBuildMethodCountIndex' must be at least or at most one 'build' method.Solutions:>A structurally modified page must have at least one and no more than one'build' method.", + "type": "ERROR" + }, + "validateHasController": { + "message": "@CustomDialog component should have a property of the CustomDialogController type.", + "type": "ERROR" + }, + "processWatch": { + "message": "Cannot find name 'onWatch' in struct 'ProcessWatchIndex'.", + "type": "ERROR" + }, + "updateBuilderParamProperty": { + "message": "BuilderParam property can only initialized by Builder function or LocalBuilder method in struct.", + "type": "ERROR" + }, + "validateMultiDecorators": { + "message": "The property 'lang' cannot have mutilate state management decorators.", + "type": "ERROR" + }, + "validatePropertyNonDefaultValue": { + "message": "The @State property 'message' must be specified a default value.", + "type": "ERROR" + }, + "validatePropertyDefaultValue": { + "message": "The @Link property 'message' cannot be specified a default value.Solutions:>Please initialize the rules according to the decorator.", + "type": "ERROR" + }, + "validatePropertyNonType": { + "message": "The property 'message' must specify a type.", + "type": "ERROR" + }, + "validateNonObservedClassType": { + "message": "The type of the @ObjectLink property 'message' can only be objects of classes decorated with @Observed class decorator in ets (not ts).", + "type": "ERROR" + }, + "validateHasIllegalDecoratorInEntry": { + "message": "The @Entry component 'ValidateHasIllegalDecoratorInEntryIndex' cannot have the @Prop property 'message'.", + "type": "WARN" + }, + "validateHasIllegalQuestionToken": { + "message": "The @ObjectLink property 'message' cannot be an optional parameter.", + "type": "WARN" + }, + "validateForbiddenUseStateType": { + "message": "The @State property 'message' cannot be a 'CustomDialogController' object.", + "type": "ERROR" + }, + "validateDuplicateDecorator": { + "message": "The inner decorator @State cannot be used together with custom decorator.", + "type": "ERROR" + }, + "validateWatchDecorator": { + "message": "Regular variable 'message' can not be decorated with @Watch.", + "type": "ERROR" + }, + "validateWatchParam": { + "message": "The parameter should be a string.", + "type": "ERROR" + }, + "validateCustomDecorator": { + "message": "The inner decorator @State cannot be used together with custom decorator.", + "type": "ERROR" + }, + "checkBuilder$$": { + "message": "Unrecognized property 'paramA1', make sure it can be assigned to @Link property 'message' by yourself.", + "type": "WARN" + }, + "validateForbiddenToInitViaParam": { + "message": "Property 'message' in the custom component 'ValidateForbiddenToInitViaParamChild' cannot be initialized here (forbidden to specify).", + "type": "ERROR" + }, + "validateMandatoryToInitViaParam": { + "message": "Property 'message' in the custom component 'ValidateMandatoryToInitViaParamChild' is missing (mandatory to specify).", + "type": "ERROR" + }, + "validateInitDecorator": [ + { + "message": "Property 'build_value' must be initialized through the component constructor.", + "type": "ERROR" + }, + { + "message": "Property 'prop_value' must be initialized through the component constructor.", + "type": "ERROR" + }, + { + "message": "Property 'regular_value' must be initialized through the component constructor.", + "type": "ERROR" + }, + { + "message": "Property 'state_value' must be initialized through the component constructor.", + "type": "ERROR" + }, + { + "message": "Property 'provide_value' must be initialized through the component constructor.", + "type": "ERROR" + } + ], + "validateIllegalInitFromParent": { + "message": "The regular property 'message' cannot be assigned to the @Link property 'message'.", + "type": "ERROR" + }, + "validateNonLinkWithDollar": { + "message": "Property 'message' cannot initialize using '$' to create a reference to a variable.", + "type": "ERROR" + }, + "validateModuleName": { + "message": "The module name 'Button' can not be the same as the inner component name.", + "type": "ERROR" + }, + "notComponent": [ + { + "message": "Decorator '@Component', '@ComponentV2', or '@CustomDialog' is missing for struct 'EntryComponent'.", + "type": "ERROR" + }, + { + "message": "A page configured in 'main_pages.json or build-profile.json5' must have one and only one '@Entry' decorator.Solutions:>Please make sure that the splash page has one and only one '@Entry' decorator.", + "type": "ERROR" + } + ], + "notConcurrent": { + "message": "The struct 'NotConcurrentIndexDecorator' use invalid decorator.", + "type": "WARN" + }, + "notConcurrentFun": { + "message": "@Concurrent can not be used on method. please use it on function declaration.", + "type": "ERROR" + }, + "notDecorator": { + "message": "The struct 'IndexDecorator' use invalid decorator.", + "type": "WARN" + }, + "StylesDuplicate": { + "message": "The struct 'StylesDuplicate' use invalid decorator.", + "type": "WARN" + }, + "vaildateDecorator": { + "message": "The struct 'VaildateDecoratorIndex' use invalid decorator.", + "type": "WARN" + }, + "state": { + "message": "The struct 'Button' cannot have the same name as the built-in component 'Button'.", + "type": "ERROR" + }, + "StructNameInvalid": { + "message": "The struct 'gesture' cannot have the same name as the built-in attribute 'gesture'.", + "type": "ERROR" + }, + "notConcurrentFunAster": { + "message": "@Concurrent can not be used on Generator function declaration.", + "type": "ERROR" + }, + "NoStructDeco": { + "message": "The '@Component' decorator can only be used with 'struct'.", + "type": "ERROR" + }, + "MethodNoExtend": { + "message": "The '@Extend' decorator can not be a member property method of a 'class' or 'struct'.", + "type": "ERROR" + }, + "OnlyStructDeco": { + "message": "The '@Builder' decorator can only be used in 'struct'.", + "type": "ERROR" + }, + "NoChild": { + "message": "The component 'Image' can't have any child.", + "type": "ERROR" + }, + "OneChild": { + "message": "The component 'Button' can only have a single child component.", + "type": "ERROR" + }, + "NotSupportResrcParam": { + "message": "The input parameter is not supported.", + "type": "ERROR" + }, + "ExtendOneChild": { + "message": "@Extend should have one and only one parameter", + "type": "ERROR" + }, + "UnknownSrc": { + "message": "Unknown resource source 'hap'.", + "type": "ERROR" + }, + "UnknownSrcType": { + "message": "Unknown resource type 'iroha'.", + "type": "ERROR" + }, + "UnknownSrcName": { + "message": "Unknown resource name 'tari'.", + "type": "ERROR" + }, + "NotSupportResrcType": { + "message": "The resource type font is not supported.", + "type": "ERROR" + }, + "NoSrc": { + "message": "No such 'test.png' resource in current module.", + "type": "ERROR" + }, + "EntryDecoParam": { + "message": "@Entry should have a parameter, like '@Entry (storage)'.", + "type": "WARN" + }, + "StylesNoParam": { + "message": "@Styles can't have parameters.", + "type": "ERROR" + }, + "ExceededPreview": { + "message": "A page can contain at most 10 '@Preview' decorators.", + "type": "ERROR" + }, + "ExceededEntry": [ + { + "message": "A page can't contain more than one '@Entry' decorator", + "type": "ERROR" + }, + { + "message": "A page configured in 'main_pages.json or build-profile.json5' must have one and only one '@Entry' decorator.Solutions:>Please make sure that the splash page has one and only one '@Entry' decorator.", + "type": "ERROR" + } + ], + "OneEntry": { + "message": "A page configured in 'main_pages.json or build-profile.json5' must have one and only one '@Entry' decorator.Solutions:>Please make sure that the splash page has one and only one '@Entry' decorator.", + "type": "ERROR" + }, + "notMethodDeco": { + "message": "'@State' can not decorate the method.", + "type": "ERROR" + }, + "checkNonspecificParents": { + "message": "The 'Blank' component can only be nested in the 'Row,Column,Flex' parent component.", + "type": "ERROR" + }, + "@Trace": [ + { + "message": "The '@Trace' decorator can only be used in 'class'.", + "type": "ERROR" + }, + { + "message": "The '@Trace' can decorate only member variables within a 'class' decorated with ObservedV2.", + "type": "ERROR" + } + ], + "@Type": [ + { + "message": "The '@Type' decorator can only be used in 'class'.", + "type": "ERROR" + }, + { + "message": "The '@Type' decorator can not be used in a 'class' decorated with Sendable.", + "type": "ERROR" + }, + { + "message": "The '@Type' can decorate only member variables in a 'class'.", + "type": "ERROR" + }, + { + "message": "The '@Type' decorator can not be used in a 'class' decorated with Observed.", + "type": "ERROR" + }, + { + "message": "The '@Type' can decorate only member variables in a 'class'.", + "type": "ERROR" + } + ], + "validate_track_observed": [ + { + "message": "The struct 'child' use invalid decorator.", + "type": "WARN" + }, + { + "message": "The '@Trace' decorator can only be used in 'class'.", + "type": "ERROR" + }, + { + "message": "The '@ObservedV2' decorator can only be used in 'class'.", + "type": "ERROR" + }, + { + "message": "The '@Trace' can decorate only member variables within a 'class' decorated with ObservedV2.", + "type": "ERROR" + } + ], + "validateAccessQualifier": [ + { + "message": "Property 'storage_value' can not be decorated with both @StorageLink and public.", + "type": "WARN" + }, + { + "message": "Property 'consume_value' can not be decorated with both @Consume and public.", + "type": "WARN" + }, + { + "message": "Property 'link_value' can not be decorated with both @Link and private.", + "type": "WARN" + }, + { + "message": "The member attributes of a struct can not be protected.", + "type": "WARN" + }, + { + "message": "Property 'prop_value' can not be decorated with both @Require and private.", + "type": "WARN" + }, + { + "message": "Property 'value' can not be decorated with both @Require and private.", + "type": "WARN" + }, + { + "message": "Property 'regular_value' is private and can not be initialized through the component constructor.", + "type": "WARN" + }, + { + "message": "Property 'state_value' is private and can not be initialized through the component constructor.", + "type": "WARN" + }, + { + "message": "Property 'prop_value' is private and can not be initialized through the component constructor.", + "type": "WARN" + }, + { + "message": "Property 'value' is private and can not be initialized through the component constructor.", + "type": "WARN" + } + ], + "@Monitor": [ + { + "message": "The '@Monitor' can decorate only member method within a 'class' decorated with ObservedV2.", + "type": "ERROR" + } + ], + "v2DecoratorInComponent": [ + { + "message": "The '@Local' decorator can only be used in a 'struct' decorated with '@ComponentV2'.", + "type": "ERROR" + }, + { + "message": "The '@Param' decorator can only be used in a 'struct' decorated with '@ComponentV2'.", + "type": "ERROR" + }, + { + "message": "The '@Param' decorator can only be used in a 'struct' decorated with '@ComponentV2'.", + "type": "ERROR" + }, + { + "message": "The '@Once' decorator can only be used in a 'struct' decorated with '@ComponentV2'.", + "type": "ERROR" + }, + { + "message": "The '@Once' decorator can only be used in a 'struct' decorated with '@ComponentV2'.", + "type": "ERROR" + }, + { + "message": "The '@Event' decorator can only be used in a 'struct' decorated with '@ComponentV2'.", + "type": "ERROR" + }, + { + "message": "The '@Provider' decorator can only be used in a 'struct' decorated with '@ComponentV2'.", + "type": "ERROR" + }, + { + "message": "The '@Consumer' decorator can only be used in a 'struct' decorated with '@ComponentV2'.", + "type": "ERROR" + }, + { + "message": "The '@Computed' decorator can only be used in a 'struct' decorated with '@ComponentV2'.", + "type": "ERROR" + }, + { + "message": "The '@Monitor' decorator can only be used in a 'struct' decorated with '@ComponentV2'.", + "type": "ERROR" + } + ], + "v1DecoratorInComponentV2": [ + { + "message": "The '@State' decorator can only be used in a 'struct' decorated with '@Component'.", + "type": "ERROR" + }, + { + "message": "The '@Prop' decorator can only be used in a 'struct' decorated with '@Component'.", + "type": "ERROR" + }, + { + "message": "The '@Link' decorator can only be used in a 'struct' decorated with '@Component'.", + "type": "ERROR" + }, + { + "message": "The '@Provide' decorator can only be used in a 'struct' decorated with '@Component'.", + "type": "ERROR" + }, + { + "message": "The '@Consume' decorator can only be used in a 'struct' decorated with '@Component'.", + "type": "ERROR" + }, + { + "message": "The '@Watch' decorator can only be used in a 'struct' decorated with '@Component'.", + "type": "ERROR" + }, + { + "message": "The '@State' decorator can only be used in a 'struct' decorated with '@Component'.", + "type": "ERROR" + }, + { + "message": "The '@Watch' decorator can only be used in a 'struct' decorated with '@Component'.", + "type": "ERROR" + }, + { + "message": "The '@StorageLink' decorator can only be used in a 'struct' decorated with '@Component'.", + "type": "ERROR" + }, + { + "message": "The '@StorageProp' decorator can only be used in a 'struct' decorated with '@Component'.", + "type": "ERROR" + }, + { + "message": "The '@LocalStorageLink' decorator can only be used in a 'struct' decorated with '@Component'.", + "type": "ERROR" + }, + { + "message": "The '@LocalStorageProp' decorator can only be used in a 'struct' decorated with '@Component'.", + "type": "ERROR" + }, + { + "message": "The '@ObjectLink' decorator can only be used in a 'struct' decorated with '@Component'.", + "type": "ERROR" + } + ], + "componentV2BothWithComponent": [ + { + "message": "The struct 'componentV2BothWithComponent' can not be decorated with '@ComponentV2' and '@Component', '@Reusable', '@CustomDialog' at the same time.", + "type": "ERROR" + }, + { + "message": "The struct 'componentV2BothWithComponent1' can not be decorated with '@ComponentV2' and '@Component', '@Reusable', '@CustomDialog' at the same time.", + "type": "ERROR" + }, + { + "message": "The struct 'componentV2BothWithComponent2' can not be decorated with '@ComponentV2' and '@Component', '@Reusable', '@CustomDialog' at the same time.", + "type": "ERROR" + } + ], + "mutiDecoratorInComponentV2": [ + { + "message": "The member property or method can not be decorated by multiple built-in decorators.", + "type": "ERROR" + }, + { + "message": "The member property or method can not be decorated by multiple built-in decorators.", + "type": "ERROR" + } + ], + "v2DecoratorInClass": [ + { + "message": "The '@Local' decorator can only be used with 'struct'.", + "type": "ERROR" + }, + { + "message": "The '@Param' decorator can only be used with 'struct'.", + "type": "ERROR" + }, + { + "message": "The '@Param' decorator can only be used with 'struct'.", + "type": "ERROR" + }, + { + "message": "The '@Once' decorator can only be used with 'struct'.", + "type": "ERROR" + }, + { + "message": "The '@Once' decorator can only be used with 'struct'.", + "type": "ERROR" + }, + { + "message": "The '@Event' decorator can only be used with 'struct'.", + "type": "ERROR" + }, + { + "message": "The '@Provider' decorator can only be used with 'struct'.", + "type": "ERROR" + }, + { + "message": "The '@Consumer' decorator can only be used with 'struct'.", + "type": "ERROR" + } + ], + "v2MemberDecorator": [ + { + "message": "@Computed can only decorate 'GetAccessor'.", + "type": "ERROR" + }, + { + "message": "'@Local' can only decorate member property.", + "type": "ERROR" + }, + { + "message": "@Computed can only decorate 'GetAccessor'.", + "type": "ERROR" + }, + { + "message": "'@Monitor' can only decorate method.", + "type": "ERROR" + } + ], + "param_require_once_check": [ + { + "message": "When a variable decorated with @Param is not assigned a default value, it must also be decorated with @Require.", + "type": "ERROR" + }, + { + "message": "In a struct decorated with @ComponentV2, @Require can only be used with @Param.", + "type": "ERROR" + }, + { + "message": "In a struct decorated with @ComponentV2, @Require can only be used with @Param.", + "type": "ERROR" + }, + { + "message": "When a variable decorated with @Once, it must also be decorated with @Param.", + "type": "ERROR" + }, + { + "message": "When a variable decorated with @Once, it must also be decorated with @Param.", + "type": "ERROR" + } + ], + "v2DecoratorInitFromParent": [ + { + "message": "Property 'param_value' must be initialized through the component constructor.", + "type": "ERROR" + }, + { + "message": "Property 'regular_value' in the custom component 'testChild' cannot be initialized here (forbidden to specify).", + "type": "ERROR" + }, + { + "message": "Property 'local_value' in the custom component 'testChild' cannot be initialized here (forbidden to specify).", + "type": "ERROR" + }, + { + "message": "Property 'provider_value' in the custom component 'testChild' cannot be initialized here (forbidden to specify).", + "type": "ERROR" + }, + { + "message": "Property 'consumer_value' in the custom component 'testChild' cannot be initialized here (forbidden to specify).", + "type": "ERROR" + } + ], + "validateParamTwoWayBind": [ + { + "message": "When the two-way binding syntax is used, the variable 'value' must be decorated with @Param, and the @Event variable '$value' must be defined in the testParamChild1.", + "type": "ERROR" + }, + { + "message": "The optional character can not be used in the initial value of property 'paramValue'.", + "type": "ERROR" + }, + { + "message": "The optional character can not be used in the initial value of property 'paramValue'.", + "type": "ERROR" + }, + { + "message": "When the two-way binding syntax is used, the initial value of property 'paramValue' must be a variable.", + "type": "ERROR" + }, + { + "message": "When the two-way binding syntax is used, the initial value of property 'paramValue' must be a variable.", + "type": "ERROR" + } + ], + "validateDifferentMethod": [ + { + "message": "A function can only be decorated by one of the 'AnimatableExtend, Builder, Extend, Styles, Concurrent and Sendable'.", + "type": "ERROR" + }, + { + "message": "A function can only be decorated by one of the 'AnimatableExtend, Builder, Extend, Styles, Concurrent and Sendable'.", + "type": "ERROR" + }, + { + "message": "The member property or method can not be decorated by multiple built-in decorators.", + "type": "ERROR" + }, + { + "message": "The member property or method can not be decorated by multiple built-in decorators.", + "type": "ERROR" + }, + { + "message": "The member property or method can not be decorated by multiple built-in decorators.", + "type": "ERROR" + }, + { + "message": "@Computed can only decorate 'GetAccessor'.", + "type": "ERROR" + }, + { + "message": "The member property or method can not be decorated by multiple built-in decorators.", + "type": "ERROR" + } + ], + "validateDuplicateMethod": [ + { + "message": "Duplicate decorators for function are not allowed.", + "type": "WARN" + }, + { + "message": "Duplicate decorators for function are not allowed.", + "type": "WARN" + }, + { + "message": "Duplicate decorators for method are not allowed.", + "type": "WARN" + }, + { + "message": "Duplicate decorators for method are not allowed.", + "type": "WARN" + }, + { + "message": "Duplicate decorators for method are not allowed.", + "type": "WARN" + }, + { + "message": "Duplicate decorators for method are not allowed.", + "type": "WARN" + }, + { + "message": "Duplicate decorators for method are not allowed.", + "type": "ERROR" + }, + { + "message": "Duplicate decorators for method are not allowed.", + "type": "ERROR" + } + ], + "v2ToV1Link": [ + { + "message": "Property 'link_value' in the custom component 'V1' is missing (mandatory to specify).", + "type": "ERROR" + }, + { + "message": "Property 'link_value' in the custom component 'V1' is missing (mandatory to specify).", + "type": "ERROR" + }, + { + "message": "The @ComponentV2 struct must not contain any @Component with an @Link decorated variable", + "type": "ERROR" + }, + { + "message": "The @ComponentV2 struct must not contain any @Component with an @Link decorated variable", + "type": "ERROR" + }, + { + "message": "The @ComponentV2 struct must not contain any @Component with an @Link decorated variable", + "type": "ERROR" + }, + { + "message": "The @ComponentV2 struct must not contain any @Component with an @Link decorated variable", + "type": "ERROR" + } + ], + "@localBuilder": [ + { + "message": "A function can only be decorated by one of the 'AnimatableExtend, Builder, Extend, Styles, Concurrent and Sendable'.", + "type": "ERROR" + }, + { + "message": "'@LocalBuilder' can only decorate method.", + "type": "ERROR" + }, + { + "message": "The member property or method can not be decorated by multiple decorators.", + "type": "ERROR" + }, + { + "message": "The '@LocalBuilder' decorator can only be used in 'struct'.", + "type": "ERROR" + }, + { + "message": "Static methods in custom components cannot be decorated by @LocalBuilder.", + "type": "ERROR" + }, + { + "message": "'xx();' does not meet UI component syntax.", + "type": "ERROR" + } + ], + "v2Component_member_type_check": [ + { + "message": "The property 'local_value' must specify a type.", + "type": "ERROR" + }, + { + "message": "The property 'builder_value' must specify a type.", + "type": "ERROR" + }, + { + "message": "The property 'param_value' must specify a type.", + "type": "ERROR" + }, + { + "message": "The property 'param_value1' must specify a type.", + "type": "ERROR" + }, + { + "message": "The property 'param_value2' must specify a type.", + "type": "ERROR" + }, + { + "message": "The property 'param_value3' must specify a type.", + "type": "ERROR" + }, + { + "message": "The property 'event_value' must specify a type.", + "type": "ERROR" + }, + { + "message": "The property 'provide_value' must specify a type.", + "type": "ERROR" + }, + { + "message": "The property 'consumer_value' must specify a type.", + "type": "ERROR" + } + ], + "v1ToV2Component": [ + { + "message": "Property 'func_value1' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'func_value2' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", + "type": "ERROR" + } + ], + "v1ToV2ComponentValidate": [ + { + "message": "The type of the @Param property can not be a class decorated with @Observed.", + "type": "ERROR" + }, + { + "message": "Property 'param_value' in the @ComponentV2 component 'TestV2Child2' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'param_value_alias_type' in the @ComponentV2 component 'TestV2Child2' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'state_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'prop_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'link_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'provide_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'consume_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'objectLink_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'storage_link_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'storage_prop_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'local_storage_link_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'local_storage_prop_value' in the @ComponentV2 component 'TestV2Child' are not allowed to be assigned values here.", + "type": "ERROR" + } + ], + "v2ToV1ComponentValidate": [ + { + "message": "The type of the @Provider property can not be a class decorated with @Observed.", + "type": "ERROR" + }, + { + "message": "The @ComponentV2 struct must not contain any @Component with an @Link decorated variable", + "type": "ERROR" + }, + { + "message": "Property 'set_value' in the @Component component 'TestV1Child1' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'set_value_alias' in the @Component component 'TestV1Child1' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "The @ComponentV2 struct must not contain any @Component with an @Link decorated variable", + "type": "ERROR" + }, + { + "message": "Property 'set_value' in the @Component component 'TestV1Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'map_value' in the @Component component 'TestV1Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'arr_value' in the @Component component 'TestV1Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'arr_value1' in the @Component component 'TestV1Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'arr_value2' in the @Component component 'TestV1Child' are not allowed to be assigned values here.", + "type": "ERROR" + }, + { + "message": "Property 'arr_value3' in the @Component component 'TestV1Child' are not allowed to be assigned values here.", + "type": "ERROR" + } + ], + "property_observe_validate": [ + { + "message": "The type of the @State property can not be a class decorated with @ObservedV2.", + "type": "ERROR" + }, + { + "message": "The type of the @State property can not be a class decorated with @ObservedV2.", + "type": "ERROR" + }, + { + "message": "The type of the @State property can not be a class decorated with @ObservedV2.", + "type": "ERROR" + }, + { + "message": "The type of the @State property can not be a class decorated with @ObservedV2.", + "type": "ERROR" + }, + { + "message": "The type of the @State property can not be a class decorated with @ObservedV2.", + "type": "ERROR" + }, + { + "message": "The type of the @Prop property can not be a class decorated with @ObservedV2.", + "type": "ERROR" + }, + { + "message": "The type of the @Link property can not be a class decorated with @ObservedV2.", + "type": "ERROR" + }, + { + "message": "The type of the @Provide property can not be a class decorated with @ObservedV2.", + "type": "ERROR" + }, + { + "message": "The type of the @Consume property can not be a class decorated with @ObservedV2.", + "type": "ERROR" + }, + { + "message": "The type of the @StorageLink property can not be a class decorated with @ObservedV2.", + "type": "ERROR" + }, + { + "message": "The type of the @StorageProp property can not be a class decorated with @ObservedV2.", + "type": "ERROR" + }, + { + "message": "The type of the @LocalStorageLink property can not be a class decorated with @ObservedV2.", + "type": "ERROR" + }, + { + "message": "The type of the @LocalStorageProp property can not be a class decorated with @ObservedV2.", + "type": "ERROR" + }, + { + "message": "The type of the @Local property can not be a class decorated with @Observed.", + "type": "ERROR" + }, + { + "message": "The type of the @Local property can not be a class decorated with @Observed.", + "type": "ERROR" + }, + { + "message": "The type of the @Local property can not be a class decorated with @Observed.", + "type": "ERROR" + }, + { + "message": "The type of the @Local property can not be a class decorated with @Observed.", + "type": "ERROR" + }, + { + "message": "The type of the @Local property can not be a class decorated with @Observed.", + "type": "ERROR" + }, + { + "message": "The type of the @Local property can not be a class decorated with @Observed.", + "type": "ERROR" + }, + { + "message": "The type of the @Param property can not be a class decorated with @Observed.", + "type": "ERROR" + }, + { + "message": "The type of the @Param property can not be a class decorated with @Observed.", + "type": "ERROR" + }, + { + "message": "The type of the @Param property can not be a class decorated with @Observed.", + "type": "ERROR" + }, + { + "message": "The type of the @Event property can not be a class decorated with @Observed.", + "type": "ERROR" + }, + { + "message": "The type of the @Provider property can not be a class decorated with @Observed.", + "type": "ERROR" + }, + { + "message": "The type of the @Consumer property can not be a class decorated with @Observed.", + "type": "ERROR" + } + ] +} \ No newline at end of file