• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022-2023 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 */
15namespace ts {
16export namespace ArkTSLinter_1_0 {
17export namespace Problems {
18
19export enum FaultID {
20  AnyType, SymbolType, ObjectLiteralNoContextType, ArrayLiteralNoContextType,
21  ComputedPropertyName, LiteralAsPropertyName, TypeQuery, RegexLiteral, IsOperator,
22  DestructuringParameter, YieldExpression, InterfaceMerging, EnumMerging, InterfaceExtendsClass, IndexMember, WithStatement,
23  ThrowStatement, IndexedAccessType, UnknownType, ForInStatement, InOperator,
24  ImportFromPath, FunctionExpression, IntersectionType,
25  ObjectTypeLiteral, CommaOperator, LimitedReturnTypeInference,
26  LambdaWithTypeParameters, ClassExpression, DestructuringAssignment,
27  DestructuringDeclaration, VarDeclaration, CatchWithUnsupportedType, DeleteOperator,
28  DeclWithDuplicateName, UnaryArithmNotNumber, ConstructorType, ConstructorIface, ConstructorFuncs, CallSignature,
29  TypeAssertion, PrivateIdentifier, LocalFunction,
30  ConditionalType, MappedType, NamespaceAsObject, ClassAsObject,
31  NonDeclarationInNamespace, GeneratorFunction, FunctionContainsThis, PropertyAccessByIndex, JsxElement,
32  EnumMemberNonConstInit, ImplementsClass, NoUndefinedPropAccess, MultipleStaticBlocks, ThisType,
33  IntefaceExtendDifProps, StructuralIdentity, DefaultImport,
34  ExportAssignment, ImportAssignment,
35  GenericCallNoTypeArgs, ParameterProperties,
36  InstanceofUnsupported, ShorthandAmbientModuleDecl, WildcardsInModuleName, UMDModuleDefinition,
37  NewTarget, DefiniteAssignment, Prototype, GlobalThis,
38  UtilityType, PropertyDeclOnFunction, FunctionApplyBindCall, ConstAssertion, ImportAssertion,
39  SpreadOperator, LimitedStdLibApi, ErrorSuppression, StrictDiagnostic, UnsupportedDecorators, ImportAfterStatement,
40  EsObjectType,
41  LAST_ID, // this should always be last enum`
42}
43
44export class FaultAttributs {
45  migratable?: boolean;
46  warning?: boolean;
47  cookBookRef = "-1";
48}
49
50export const faultsAttrs: FaultAttributs[] = [];
51
52faultsAttrs[FaultID.LiteralAsPropertyName] = { migratable: true, cookBookRef: "1", };
53faultsAttrs[FaultID.ComputedPropertyName] = { cookBookRef: "1", };
54faultsAttrs[FaultID.SymbolType] = { cookBookRef: "2", };
55faultsAttrs[FaultID.PrivateIdentifier] = { migratable: true, cookBookRef: "3", };
56faultsAttrs[FaultID.DeclWithDuplicateName] = { migratable: true, cookBookRef: "4", };
57faultsAttrs[FaultID.VarDeclaration] = { migratable: true, cookBookRef: "5", };
58faultsAttrs[FaultID.AnyType] = { cookBookRef: "8" };
59faultsAttrs[FaultID.UnknownType] = { cookBookRef: "8", };
60faultsAttrs[FaultID.CallSignature] = { cookBookRef: "14", };
61faultsAttrs[FaultID.ConstructorType] = { cookBookRef: "15", };
62faultsAttrs[FaultID.MultipleStaticBlocks] = { cookBookRef: "16", };
63faultsAttrs[FaultID.IndexMember] = { cookBookRef: "17", };
64faultsAttrs[FaultID.IntersectionType] = { cookBookRef: "19", };
65faultsAttrs[FaultID.ThisType] = { cookBookRef: "21", };
66faultsAttrs[FaultID.ConditionalType] = { cookBookRef: "22", };
67faultsAttrs[FaultID.ParameterProperties] = { migratable: true, cookBookRef: "25", };
68faultsAttrs[FaultID.ConstructorIface] = { cookBookRef: "27", };
69faultsAttrs[FaultID.IndexedAccessType] = { cookBookRef: "28", };
70faultsAttrs[FaultID.PropertyAccessByIndex] = { migratable: true, cookBookRef: "29", };
71faultsAttrs[FaultID.StructuralIdentity] = { cookBookRef: "30", };
72faultsAttrs[FaultID.GenericCallNoTypeArgs] = { cookBookRef: "34", };
73faultsAttrs[FaultID.RegexLiteral] = { cookBookRef: "37", };
74faultsAttrs[FaultID.ObjectLiteralNoContextType] = { cookBookRef: "38", };
75faultsAttrs[FaultID.ObjectTypeLiteral] = { cookBookRef: "40", };
76faultsAttrs[FaultID.ArrayLiteralNoContextType] = { cookBookRef: "43", };
77faultsAttrs[FaultID.FunctionExpression] = { migratable: true, cookBookRef: "46", };
78faultsAttrs[FaultID.LambdaWithTypeParameters] = { migratable: true, cookBookRef: "49", };
79faultsAttrs[FaultID.ClassExpression] = { migratable: true, cookBookRef: "50", };
80faultsAttrs[FaultID.ImplementsClass] = { cookBookRef: "51", };
81faultsAttrs[FaultID.NoUndefinedPropAccess] = { cookBookRef: "52", };
82faultsAttrs[FaultID.TypeAssertion] = { migratable: true, cookBookRef: "53", };
83faultsAttrs[FaultID.JsxElement] = { cookBookRef: "54", };
84faultsAttrs[FaultID.UnaryArithmNotNumber] = { cookBookRef: "55", };
85faultsAttrs[FaultID.DeleteOperator] = { cookBookRef: "59", };
86faultsAttrs[FaultID.TypeQuery] = { cookBookRef: "60", };
87faultsAttrs[FaultID.InstanceofUnsupported] = { cookBookRef: "65", };
88faultsAttrs[FaultID.InOperator] = { cookBookRef: "66", };
89faultsAttrs[FaultID.DestructuringAssignment] = { migratable: true, cookBookRef: "69", };
90faultsAttrs[FaultID.CommaOperator] = { cookBookRef: "71", };
91faultsAttrs[FaultID.DestructuringDeclaration] = { migratable: true, cookBookRef: "74", };
92faultsAttrs[FaultID.CatchWithUnsupportedType] = { migratable: true, cookBookRef: "79", };
93faultsAttrs[FaultID.ForInStatement] = { cookBookRef: "80", };
94faultsAttrs[FaultID.MappedType] = { cookBookRef: "83", };
95faultsAttrs[FaultID.WithStatement] = { cookBookRef: "84", };
96faultsAttrs[FaultID.ThrowStatement] = { migratable: true, cookBookRef: "87", };
97faultsAttrs[FaultID.LimitedReturnTypeInference] = { migratable: true, cookBookRef: "90", };
98faultsAttrs[FaultID.DestructuringParameter] = { cookBookRef: "91", };
99faultsAttrs[FaultID.LocalFunction] = { migratable: true, cookBookRef: "92", };
100faultsAttrs[FaultID.FunctionContainsThis] = { cookBookRef: "93", };
101faultsAttrs[FaultID.GeneratorFunction] = { cookBookRef: "94", };
102faultsAttrs[FaultID.YieldExpression] = { cookBookRef: "94", };
103faultsAttrs[FaultID.IsOperator] = { cookBookRef: "96", };
104faultsAttrs[FaultID.SpreadOperator] = { cookBookRef: "99", };
105faultsAttrs[FaultID.IntefaceExtendDifProps] = { cookBookRef: "102", };
106faultsAttrs[FaultID.InterfaceMerging] = { cookBookRef: "103", };
107faultsAttrs[FaultID.InterfaceExtendsClass] = { cookBookRef: "104", };
108faultsAttrs[FaultID.ConstructorFuncs] = { cookBookRef: "106", };
109faultsAttrs[FaultID.EnumMemberNonConstInit] = { cookBookRef: "111", };
110faultsAttrs[FaultID.EnumMerging] = { cookBookRef: "113", };
111faultsAttrs[FaultID.NamespaceAsObject] = { cookBookRef: "114", };
112faultsAttrs[FaultID.NonDeclarationInNamespace] = { cookBookRef: "116", };
113faultsAttrs[FaultID.ImportFromPath] = { cookBookRef: "119", };
114faultsAttrs[FaultID.DefaultImport] = { migratable: true, cookBookRef: "120", };
115faultsAttrs[FaultID.ImportAssignment] = { cookBookRef: "121", };
116faultsAttrs[FaultID.ExportAssignment] = { cookBookRef: "126", };
117faultsAttrs[FaultID.ShorthandAmbientModuleDecl] = { cookBookRef: "128", };
118faultsAttrs[FaultID.WildcardsInModuleName] = { cookBookRef: "129", };
119faultsAttrs[FaultID.UMDModuleDefinition] = { cookBookRef: "130", };
120faultsAttrs[FaultID.NewTarget] = { cookBookRef: "132", };
121faultsAttrs[FaultID.DefiniteAssignment] = { warning: true, cookBookRef: "134", };
122faultsAttrs[FaultID.Prototype] = { cookBookRef: "136", };
123faultsAttrs[FaultID.GlobalThis] = { cookBookRef: "137", };
124faultsAttrs[FaultID.UtilityType] = { cookBookRef: "138", };
125faultsAttrs[FaultID.PropertyDeclOnFunction] = { cookBookRef: "139", };
126faultsAttrs[FaultID.FunctionApplyBindCall] = { cookBookRef: "140", };
127faultsAttrs[FaultID.ConstAssertion] = { cookBookRef: "142", };
128faultsAttrs[FaultID.ImportAssertion] = { cookBookRef: "143", };
129faultsAttrs[FaultID.LimitedStdLibApi] = { cookBookRef: "144", };
130faultsAttrs[FaultID.StrictDiagnostic] = { cookBookRef: "145", };
131faultsAttrs[FaultID.ErrorSuppression] = { cookBookRef: "146", };
132faultsAttrs[FaultID.UnsupportedDecorators] = { warning: true, cookBookRef: "148", };
133faultsAttrs[FaultID.ClassAsObject] = { cookBookRef: "149", };
134faultsAttrs[FaultID.ImportAfterStatement] = { cookBookRef: "150", };
135faultsAttrs[FaultID.EsObjectType] = { warning: true, cookBookRef: "151" };
136}
137}
138}