• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023-2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import { FaultID } from './Problems';
17
18export const faultDesc: string[] = [];
19
20faultDesc[FaultID.AnyType] = '"any" type';
21faultDesc[FaultID.SymbolType] = '"symbol" type';
22faultDesc[FaultID.ObjectLiteralNoContextType] = 'Object literals with no context Class or Interface type';
23faultDesc[FaultID.ArrayLiteralNoContextType] = 'Array literals with no context Array type';
24faultDesc[FaultID.ComputedPropertyName] = 'Computed properties';
25faultDesc[FaultID.LiteralAsPropertyName] = 'String or integer literal as property name';
26faultDesc[FaultID.TypeQuery] = '"typeof" operations';
27faultDesc[FaultID.IsOperator] = '"is" operations';
28faultDesc[FaultID.DestructuringParameter] = 'destructuring parameters';
29faultDesc[FaultID.YieldExpression] = '"yield" operations';
30faultDesc[FaultID.InterfaceMerging] = 'merging interfaces';
31faultDesc[FaultID.EnumMerging] = 'merging enums';
32faultDesc[FaultID.InterfaceExtendsClass] = 'interfaces inherited from classes';
33faultDesc[FaultID.IndexMember] = 'index members';
34faultDesc[FaultID.WithStatement] = '"with" statements';
35faultDesc[FaultID.ThrowStatement] = '"throw" statements with expression of wrong type';
36faultDesc[FaultID.IndexedAccessType] = 'Indexed access type';
37faultDesc[FaultID.UnknownType] = '"unknown" type';
38faultDesc[FaultID.ForInStatement] = '"for-In" statements';
39faultDesc[FaultID.InOperator] = '"in" operations';
40faultDesc[FaultID.FunctionExpression] = 'function expressions';
41faultDesc[FaultID.IntersectionType] = 'intersection types and type literals';
42faultDesc[FaultID.ObjectTypeLiteral] = 'Object type literals';
43faultDesc[FaultID.CommaOperator] = 'comma operator';
44faultDesc[FaultID.LimitedReturnTypeInference] = 'Functions with limited return type inference';
45faultDesc[FaultID.ClassExpression] = 'Class expressions';
46faultDesc[FaultID.DestructuringAssignment] = 'Destructuring assignments';
47faultDesc[FaultID.DestructuringDeclaration] = 'Destructuring variable declarations';
48faultDesc[FaultID.VarDeclaration] = '"var" declarations';
49faultDesc[FaultID.CatchWithUnsupportedType] = '"catch" clause with unsupported exception type';
50faultDesc[FaultID.DeleteOperator] = '"delete" operations';
51faultDesc[FaultID.DeclWithDuplicateName] = 'Declarations with duplicate name';
52faultDesc[FaultID.UnaryArithmNotNumber] = 'Unary arithmetics with not-numeric values';
53faultDesc[FaultID.ConstructorType] = 'Constructor type';
54faultDesc[FaultID.ConstructorFuncs] = 'Constructor function type is not supported';
55faultDesc[FaultID.ConstructorIface] = 'Construct signatures are not supported in interfaces';
56faultDesc[FaultID.CallSignature] = 'Call signatures';
57faultDesc[FaultID.TypeAssertion] = 'Type assertion expressions';
58faultDesc[FaultID.PrivateIdentifier] = 'Private identifiers (with "#" prefix)';
59faultDesc[FaultID.LocalFunction] = 'Local function declarations';
60faultDesc[FaultID.ConditionalType] = 'Conditional type';
61faultDesc[FaultID.MappedType] = 'Mapped type';
62faultDesc[FaultID.NamespaceAsObject] = 'Namespaces used as objects';
63faultDesc[FaultID.ClassAsObject] = faultDesc[FaultID.ClassAsObjectError] = 'Class used as object';
64faultDesc[FaultID.NonDeclarationInNamespace] = 'Non-declaration statements in namespaces';
65faultDesc[FaultID.GeneratorFunction] = 'Generator functions';
66faultDesc[FaultID.FunctionContainsThis] = 'Functions containing "this"';
67faultDesc[FaultID.PropertyAccessByIndex] = 'property access by index';
68faultDesc[FaultID.NoStaticOnClass] = 'No static blocks on classes';
69faultDesc[FaultID.NoConstructorOnClass] = 'No constructor field on object';
70faultDesc[FaultID.RuntimeArrayCheck] = 'Array bound not checked';
71faultDesc[FaultID.JsxElement] = 'JSX Elements';
72faultDesc[FaultID.EnumMemberNonConstInit] = 'Enum members with non-constant initializer';
73faultDesc[FaultID.ImplementsClass] = 'Class type mentioned in "implements" clause';
74faultDesc[FaultID.MethodReassignment] = 'Access to undefined field';
75faultDesc[FaultID.MultipleStaticBlocks] = 'Multiple static blocks';
76faultDesc[FaultID.ThisType] = '"this" type';
77faultDesc[FaultID.IntefaceExtendDifProps] = 'Extends same properties with different types';
78faultDesc[FaultID.StructuralIdentity] = 'Use of type structural identity';
79faultDesc[FaultID.ExportAssignment] = 'Export assignments (export = ..)';
80faultDesc[FaultID.ImportAssignment] = 'Import assignments (import = ..)';
81faultDesc[FaultID.GenericCallNoTypeArgs] = 'Generic calls without type arguments';
82faultDesc[FaultID.ParameterProperties] = 'Parameter properties in constructor';
83faultDesc[FaultID.InstanceofUnsupported] = 'Left-hand side of "instanceof" is wrong';
84faultDesc[FaultID.ShorthandAmbientModuleDecl] = 'Shorthand ambient module declaration';
85faultDesc[FaultID.WildcardsInModuleName] = 'Wildcards in module name';
86faultDesc[FaultID.UMDModuleDefinition] = 'UMD module definition';
87faultDesc[FaultID.NewTarget] = '"new.target" meta-property';
88faultDesc[FaultID.DefiniteAssignment] = faultDesc[FaultID.DefiniteAssignmentError] = 'Definite assignment assertion';
89faultDesc[FaultID.Prototype] = 'Prototype assignment';
90faultDesc[FaultID.GlobalThis] = faultDesc[FaultID.GlobalThisError] = 'Use of globalThis';
91faultDesc[FaultID.UtilityType] = 'Standard Utility types';
92faultDesc[FaultID.PropertyDeclOnFunction] = 'Property declaration on function';
93faultDesc[FaultID.FunctionApplyCall] = 'Invoking methods of function objects';
94faultDesc[FaultID.FunctionBind] = faultDesc[FaultID.FunctionBindError] = 'Invoking methods of function objects';
95faultDesc[FaultID.ConstAssertion] = '"as const" assertion';
96faultDesc[FaultID.ImportAssertion] = 'Import assertion';
97faultDesc[FaultID.SpreadOperator] = 'Spread operation';
98faultDesc[FaultID.LimitedStdLibApi] = 'Limited standard library API';
99faultDesc[FaultID.LimitedStdLibNoASON] = 'Cannot find symbol ASON.';
100faultDesc[FaultID.NoNeedStdLibSendableContainer] = 'Sendable Containers not supported';
101faultDesc[FaultID.ErrorSuppression] = 'Error suppression annotation';
102faultDesc[FaultID.StrictDiagnostic] = 'Strict diagnostic';
103faultDesc[FaultID.ImportAfterStatement] = 'Import declaration after other declaration or statement';
104faultDesc[FaultID.EsValueType] = faultDesc[FaultID.EsValueTypeError] = 'Restricted "ESValue" type';
105faultDesc[FaultID.SendableClassInheritance] = 'Sendable class inheritance';
106faultDesc[FaultID.SendablePropType] = 'Sendable class property';
107faultDesc[FaultID.SendableDefiniteAssignment] = 'Use of definite assignment assertion in "Sendable" class';
108faultDesc[FaultID.SendableGenericTypes] = 'Sendable generic types';
109faultDesc[FaultID.SendableCapturedVars] = 'Sendable class captured variables';
110faultDesc[FaultID.SendableClassDecorator] = 'Sendable class decorator';
111faultDesc[FaultID.SendableObjectInitialization] =
112  'Object literal or array literal is not allowed to initialize a "Sendable" object';
113faultDesc[FaultID.SendableComputedPropName] = 'Sendable computed property name';
114faultDesc[FaultID.SendableAsExpr] = 'Sendable as expr';
115faultDesc[FaultID.SharedNoSideEffectImport] = 'Shared no side effect import';
116faultDesc[FaultID.SharedModuleExports] = 'Shared module exports';
117faultDesc[FaultID.SharedModuleNoWildcardExport] = 'Share module no wildcard export';
118faultDesc[FaultID.NoTsImportEts] = 'No ts Import Ets';
119faultDesc[FaultID.SendableTypeInheritance] = 'Sendable type inheritance';
120faultDesc[FaultID.SendableTypeExported] = 'Sendable type exported';
121faultDesc[FaultID.NoTsReExportEts] = 'No ts re-export ets';
122faultDesc[FaultID.NoSideEffectImportEtsToTs] = 'No side effect import ets to ts';
123faultDesc[FaultID.NoNameSpaceImportEtsToTs] = 'No namespace import ets to ts';
124faultDesc[FaultID.SendableExplicitFieldType] = 'Field in sendable class must have type annotation';
125faultDesc[FaultID.SendableFunctionImportedVariables] = 'Sendable function imported variables';
126faultDesc[FaultID.SendableFunctionDecorator] = 'Sendable function decorator';
127faultDesc[FaultID.SendableTypeAliasDecorator] = 'Sendable typeAlias decorator';
128faultDesc[FaultID.SendableTypeAliasDeclaration] = 'Sendable typeAlias declaration';
129faultDesc[FaultID.SendableFunctionAssignment] = 'Sendable function assignment';
130faultDesc[FaultID.SendableFunctionOverloadDecorator] = 'Sendable function overload decorator';
131faultDesc[FaultID.SendableFunctionProperty] = 'Sendable function property';
132faultDesc[FaultID.SendableFunctionAsExpr] = 'Sendable function as expr';
133faultDesc[FaultID.SendableDecoratorLimited] = 'Sendable decorator limited';
134faultDesc[FaultID.SharedModuleExportsWarning] = 'Shared module exports Warning';
135faultDesc[FaultID.SendableBetaCompatible] = 'Sendable beta compatible';
136faultDesc[FaultID.ObjectLiteralProperty] = 'Object literal property';
137faultDesc[FaultID.OptionalMethod] = 'Optional method';
138faultDesc[FaultID.ImportType] = 'Import type syntax';
139faultDesc[FaultID.DynamicCtorCall] = 'Dynamic constructor call';
140faultDesc[FaultID.MathPow] = 'Exponent call';
141faultDesc[FaultID.IncompationbleFunctionType] = 'Incompationble function type';
142faultDesc[FaultID.VoidOperator] = 'Void operator';
143faultDesc[FaultID.ExponentOp] = 'Exponent operation';
144faultDesc[FaultID.RegularExpressionLiteral] = 'Regex literals';
145faultDesc[FaultID.ArgumentsObject] = 'Special arguments object inside functions';
146faultDesc[FaultID.LimitedVoidType] = 'Limited void type';
147faultDesc[FaultID.DecoratorsNotSupported] = 'Decorators are not supported';
148faultDesc[FaultID.DebuggerStatement] = 'Debugger statement';
149faultDesc[FaultID.TsOverload] = 'Ts Overload';
150faultDesc[FaultID.NoSideEffectImport] = 'No side effect import';
151faultDesc[FaultID.DynamicImport] = 'Dynamic import';
152faultDesc[FaultID.ImportLazyIdentifier] = 'Import Lazy Identifier';
153faultDesc[FaultID.CaseExpression] = 'Case Expression';
154faultDesc[FaultID.SwitchExpression] = 'Switch Expression';
155faultDesc[FaultID.LimitedLiteralType] = 'Limited literal type';
156faultDesc[FaultID.IndexNegative] = 'Index negative';
157faultDesc[FaultID.ArrayIndexExprType] = 'Array index expr type';
158faultDesc[FaultID.NoTuplesArrays] = 'No tuples arrays';
159faultDesc[FaultID.DoubleExclaBindingNotSupported] = 'Incorrect bidirectional data binding used "!!"';
160faultDesc[FaultID.DoubleDollarBindingNotSupported] = 'Incorrect bidirectional data binding used "$$"';
161faultDesc[FaultID.DollarBindingNotSupported] = 'Link decorator passing';
162faultDesc[FaultID.ExtendDecoratorNotSupported] = '"@Extend" decorator';
163faultDesc[FaultID.MethodOverridingField] = '"Method overriding field" to keep style consistent';
164faultDesc[FaultID.InteropJsObjectConditionJudgment] = 'Interop JS Object usage in a condition';
165faultDesc[FaultID.InteropJsObjectExpandStaticInstance] = 'Interop JS function usage';
166faultDesc[FaultID.InteropJSFunctionInvoke] = 'Interop JS function invoke';
167faultDesc[FaultID.ExplicitFunctionType] = 'Not explicit function type';
168faultDesc[FaultID.ClassstaticInitialization] = 'The static properties of a class need to have initial values';
169faultDesc[FaultID.AvoidUnionTypes] = 'Union types';
170faultDesc[FaultID.TaggedTemplates] = 'Tagged template';
171faultDesc[FaultID.InvalidIdentifier] = 'Invalid identifiers';
172faultDesc[FaultID.ExtendsExpression] = 'Extends Expression';
173faultDesc[FaultID.NumericSemantics] = 'Numeric semantics';
174faultDesc[FaultID.AnimatableExtendDecoratorTransform] = '"@AnimatableExtend" decorator';
175faultDesc[FaultID.InteropJsObjectExport] = 'Interop JS object export';
176faultDesc[FaultID.DefaultArgsBehindRequiredArgs] = 'Default parameters before mandatory';
177faultDesc[FaultID.NoDuplicateFunctionName] = 'No duplicate function name';
178faultDesc[FaultID.OhmUrlFullPath] = 'Require full path file name';
179faultDesc[FaultID.UIInterfaceImport] = 'UI interface';
180faultDesc[FaultID.StylesDecoratorNotSupported] = '"@Styles" decorator';
181faultDesc[FaultID.DataObservation] = 'Data observation';
182faultDesc[FaultID.InteropCallReflect] = 'Interop call with Reflect API';
183faultDesc[FaultID.InteropCallObjectParam] = 'Interop call with "Object" parameter';
184faultDesc[FaultID.InteropDirectAccessToTSTypes] = 'TS Types Access';
185faultDesc[FaultID.InteropTSFunctionInvoke] = 'TS Function Invoke';
186faultDesc[FaultID.LimitedVoidTypeFromSdk] = 'Limited void type from sdk';
187faultDesc[FaultID.UseSharedDeprecated] = '"use shared" is not supported';
188faultDesc[FaultID.UseConcurrentDeprecated] = '"use concurrent" is not supported';
189faultDesc[FaultID.MethodInheritRule] = 'Method parameters/returns violate inheritance principles';
190faultDesc[FaultID.EntryAnnotation] = '"@Entry" decorator parameter';
191faultDesc[FaultID.ProvideAnnotation] = '"@Provide" decorator parameter';
192faultDesc[FaultID.InteropJsObjectInheritance] = 'Interop JS class inheritance';
193faultDesc[FaultID.InteropJsObjectTraverseJsInstance] = 'Interop JS object traverse usage';
194faultDesc[FaultID.InteropJsObjectCallStaticFunc] = 'Interop JS function usage';
195faultDesc[FaultID.OptionalMethodFromSdk] = 'Optional method from sdk';
196faultDesc[FaultID.SendablePropTypeFromSdk] = 'ISendable is no longer supported';
197faultDesc[FaultID.ConstructorIfaceFromSdk] = 'Construct signatures are not supported in interfaces from sdk';
198faultDesc[FaultID.PropertyAccessByIndexFromSdk] = 'property access by index from sdk';
199faultDesc[FaultID.ConstructorTypesDeprecated] = 'Constructor funcs';
200faultDesc[FaultID.QuotedHyphenPropsDeprecated] = 'Quoted hyphen props deprecated';
201faultDesc[FaultID.DuplicateDeclNameFromSdk] = 'The API path has been changed due to the duplicate names in sdk.';
202faultDesc[FaultID.SdkTypeQuery] = 'No typeof as a type in API';
203faultDesc[FaultID.IsConcurrentDeprecated] = 'isConcurrent is not supported';
204faultDesc[FaultID.InteropStaticObjectLiterals] = 'Interop call object literals';
205faultDesc[FaultID.LimitedStdLibNoImportConcurrency] = 'Import Concurrency Deprecated';
206faultDesc[FaultID.MissingSuperCall] = 'Missing super call with args';
207faultDesc[FaultID.InterOpImportJs] = 'No JS import';
208faultDesc[FaultID.InteropObjectLiteralAmbiguity] = 'Interop Object Literal ambiguity';
209faultDesc[FaultID.InteropObjectLiteralClass] = 'Interop Object Literal incompatible with class';
210faultDesc[FaultID.UnsupportPropNameFromValue] = 'Enum cannot get member name by value';
211faultDesc[FaultID.CallJSFunction] = 'Call JS Function';
212faultDesc[FaultID.InteropObjectProperty] = 'Interop property access';
213faultDesc[FaultID.InterOpConvertImport] = 'No import primitive types from js file';
214faultDesc[FaultID.InterOpImportJsForTypeOf] = 'TypeOf import from JS';
215faultDesc[FaultID.InteropNoHaveNum] = 'Interop obj with "num" property';
216faultDesc[FaultID.BinaryOperations] = 'Binary operations on js objects';
217faultDesc[FaultID.InterOpImportJsDataCompare] = 'NO js import data compare';
218faultDesc[FaultID.InteropEqualityJudgment] = 'Equality operator with JS objects';
219faultDesc[FaultID.InterOpImportJsIndex] = 'No js index import';
220faultDesc[FaultID.InstantiatedJsOjbect] = 'Instantiated js ojbect';
221faultDesc[FaultID.InteropCallObjectMethods] = 'Interop call methods in object';
222faultDesc[FaultID.InteropJsInstanceof] = 'Instanceof operator with interop';
223faultDesc[FaultID.InteropIncrementDecrement] = 'Interop increment or decrement';
224faultDesc[FaultID.BuiltinThisArgs] = 'No thisArgs as a type in API';
225faultDesc[FaultID.BuiltinSymbolIterator] = 'No "Symbol.iterator" in API';
226faultDesc[FaultID.NoPropertyDescriptor] = 'Not support property descriptor';
227faultDesc[FaultID.BuiltinNoCtorFunc] = 'Api is not support ctor-signature and call-signature';
228faultDesc[FaultID.SharedArrayBufferDeprecated] = 'SharedArrayBuffer is not supported';
229faultDesc[FaultID.SetCloneListDeprecated] = 'setCloneList is not supported';
230faultDesc[FaultID.SetTransferListDeprecated] = 'setTransferList is not supported';
231faultDesc[FaultID.SdkAbilityAsynchronousLifecycle] = '1.2 Void cannot be combined';
232faultDesc[FaultID.LimitedStdLibNoSendableDecorator] = 'Limited stdlib no sendable decorator';
233faultDesc[FaultID.LimitedStdLibNoDoncurrentDecorator] = 'Limited stdlib no concurrent decorator';
234faultDesc[FaultID.NoNeedStdlibWorker] = 'No need stdlib worker';
235faultDesc[FaultID.BuiltinGetOwnPropertyNames] = 'No "Object.getOwnPropertyNames" in API';
236faultDesc[FaultID.LocalBuilderDecoratorNotSupported] = '"@LocalBuilder" decorator';
237faultDesc[FaultID.MakeObservedIsNotSupported] = 'MakeObserved is not supported';
238faultDesc[FaultID.NoEnumPropAsType] = 'No enum prop as type';
239faultDesc[FaultID.NoAwaitJsPromise] = 'No await js promise';
240faultDesc[FaultID.NosparseArray] = 'No sparse array';
241faultDesc[FaultID.NoTsLikeSmartType] = 'No ts like smart type';
242faultDesc[FaultID.ArrayTypeImmutable] = 'Array type immutable';
243faultDesc[FaultID.CreatingPrimitiveTypes] = 'Creating primitive types';
244faultDesc[FaultID.TsLikeCatchType] = 'TS like catch type';
245faultDesc[FaultID.NumericBigintCompare] = 'No Comparison number between bigint';
246faultDesc[FaultID.NondecimalBigint] = 'No non decimal';
247faultDesc[FaultID.UnsupportOperator] = 'Unsupport operator';
248faultDesc[FaultID.CustomLayoutNeedAddDecorator] = 'Custom layout need add decorator';
249faultDesc[FaultID.PropDecoratorNotSupported] = '"@Prop" decorator is not supported';
250faultDesc[FaultID.StoragePropDecoratorNotSupported] = '"@StorageProp" decorator is not supported';
251faultDesc[FaultID.LocalStoragePropDecoratorNotSupported] = '"@LocalStorageProp" decorator is not supported';
252faultDesc[FaultID.PropFunctionNotSupported] = '"prop" function is not supported';
253faultDesc[FaultID.SetAndPropFunctionNotSupported] = '"setAndProp" function is not supported';
254faultDesc[FaultID.PropNeedCallMethodForDeepCopy] = 'Deep copy needs to call the specific method';
255faultDesc[FaultID.StateStylesBlockNeedArrowFunc] = 'StateStyles needs arrow function block';
256faultDesc[FaultID.PromiseVoidNeedResolveArg] = 'Promise<void>constructor only supports using resolve (undefined)';
257