1/*
2 * Copyright (c) 2023-2024 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.JsxElement] = 'JSX Elements';
69faultDesc[FaultID.EnumMemberNonConstInit] = 'Enum members with non-constant initializer';
70faultDesc[FaultID.ImplementsClass] = 'Class type mentioned in "implements" clause';
71faultDesc[FaultID.MethodReassignment] = 'Access to undefined field';
72faultDesc[FaultID.MultipleStaticBlocks] = 'Multiple static blocks';
73faultDesc[FaultID.ThisType] = '"this" type';
74faultDesc[FaultID.IntefaceExtendDifProps] = 'Extends same properties with different types';
75faultDesc[FaultID.StructuralIdentity] = 'Use of type structural identity';
76faultDesc[FaultID.ExportAssignment] = 'Export assignments (export = ..)';
77faultDesc[FaultID.ImportAssignment] = 'Import assignments (import = ..)';
78faultDesc[FaultID.GenericCallNoTypeArgs] = 'Generic calls without type arguments';
79faultDesc[FaultID.ParameterProperties] = 'Parameter properties in constructor';
80faultDesc[FaultID.InstanceofUnsupported] = 'Left-hand side of "instanceof" is wrong';
81faultDesc[FaultID.ShorthandAmbientModuleDecl] = 'Shorthand ambient module declaration';
82faultDesc[FaultID.WildcardsInModuleName] = 'Wildcards in module name';
83faultDesc[FaultID.UMDModuleDefinition] = 'UMD module definition';
84faultDesc[FaultID.NewTarget] = '"new.target" meta-property';
85faultDesc[FaultID.DefiniteAssignment] = faultDesc[FaultID.DefiniteAssignmentError] = 'Definite assignment assertion';
86faultDesc[FaultID.Prototype] = 'Prototype assignment';
87faultDesc[FaultID.GlobalThis] = faultDesc[FaultID.GlobalThisError] = 'Use of globalThis';
88faultDesc[FaultID.UtilityType] = 'Standard Utility types';
89faultDesc[FaultID.PropertyDeclOnFunction] = 'Property declaration on function';
90faultDesc[FaultID.FunctionApplyCall] = 'Invoking methods of function objects';
91faultDesc[FaultID.FunctionBind] = faultDesc[FaultID.FunctionBindError] = 'Invoking methods of function objects';
92faultDesc[FaultID.ConstAssertion] = '"as const" assertion';
93faultDesc[FaultID.ImportAssertion] = 'Import assertion';
94faultDesc[FaultID.SpreadOperator] = 'Spread operation';
95faultDesc[FaultID.LimitedStdLibApi] = 'Limited standard library API';
96faultDesc[FaultID.ErrorSuppression] = 'Error suppression annotation';
97faultDesc[FaultID.StrictDiagnostic] = 'Strict diagnostic';
98faultDesc[FaultID.ImportAfterStatement] = 'Import declaration after other declaration or statement';
99faultDesc[FaultID.EsObjectType] = faultDesc[FaultID.EsObjectTypeError] = 'Restricted "ESObject" type';
100faultDesc[FaultID.SendableClassInheritance] = 'Sendable class inheritance';
101faultDesc[FaultID.SendablePropType] = 'Sendable class property';
102faultDesc[FaultID.SendableDefiniteAssignment] = 'Use of definite assignment assertion in "Sendable" class';
103faultDesc[FaultID.SendableGenericTypes] = 'Sendable generic types';
104faultDesc[FaultID.SendableCapturedVars] = 'Sendable class captured variables';
105faultDesc[FaultID.SendableClassDecorator] = 'Sendable class decorator';
106faultDesc[FaultID.SendableObjectInitialization] =
107  'Object literal or array literal is not allowed to initialize a "Sendable" object';
108faultDesc[FaultID.SendableComputedPropName] = 'Sendable computed property name';
109faultDesc[FaultID.SendableAsExpr] = 'Sendable as expr';
110faultDesc[FaultID.SharedNoSideEffectImport] = 'Shared no side effect import';
111faultDesc[FaultID.SharedModuleExports] = 'Shared module exports';
112faultDesc[FaultID.SharedModuleNoWildcardExport] = 'Share module no wildcard export';
113faultDesc[FaultID.NoTsImportEts] = 'No ts Import Ets';
114faultDesc[FaultID.SendableTypeInheritance] = 'Sendable type inheritance';
115faultDesc[FaultID.SendableTypeExported] = 'Sendable type exported';
116faultDesc[FaultID.NoTsReExportEts] = 'No ts re-export ets';
117faultDesc[FaultID.NoSIdeEffectImportEtsToTs] = 'No side effect import ets to ts';
118faultDesc[FaultID.NoNameSpaceImportEtsToTs] = 'No namespace import ets to ts';
119faultDesc[FaultID.SendableExplicitFieldType] = 'Field in sendable class must have type annotation';
120faultDesc[FaultID.SendableFunctionImportedVariables] = 'Sendable function imported variables';
121faultDesc[FaultID.SendableFunctionDecorator] = 'Sendable function decorator';
122faultDesc[FaultID.SendableTypeAliasDecorator] = 'Sendable typeAlias decorator';
123faultDesc[FaultID.SendableTypeAliasDeclaration] = 'Sendable typeAlias declaration';
124faultDesc[FaultID.SendableFunctionAssignment] = 'Sendable function assignment';
125faultDesc[FaultID.SendableFunctionOverloadDecorator] = 'Sendable function overload decorator';
126faultDesc[FaultID.SendableFunctionProperty] = 'Sendable function property';
127faultDesc[FaultID.SendableFunctionAsExpr] = 'Sendable function as expr';
128faultDesc[FaultID.SendableDecoratorLimited] = 'Sendable decorator limited';
129faultDesc[FaultID.SendableClosureExport] = 'Sendable closure export';
130faultDesc[FaultID.SharedModuleExportsWarning] = 'Shared module exports Warning';
131faultDesc[FaultID.SendableBetaCompatible] = 'Sendable beta compatible';
132faultDesc[FaultID.ObjectLiteralProperty] = 'Object literal property';
133faultDesc[FaultID.OptionalMethod] = 'Optional method';
134faultDesc[FaultID.ImportType] = 'Import type syntax';
135faultDesc[FaultID.DynamicCtorCall] = 'Dynamic constructor call';
136