• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 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
16export const arkts2Rules: number[] = [
17  1,
18  25,
19  30,
20  34,
21  37,
22  29,
23  111,
24  134,
25  137,
26  139,
27  140,
28  144,
29  149,
30  183,
31  184,
32  189,
33  190,
34  191,
35  192,
36  193,
37  198,
38  199,
39  202,
40  203,
41  206,
42  207,
43  208,
44  209,
45  210,
46  211,
47  212,
48  213,
49  214,
50  215,
51  222,
52  232,
53  233,
54  234,
55  235,
56  236,
57  237,
58  238,
59  239,
60  251,
61  252,
62  253,
63  254,
64  255,
65  256,
66  257,
67  258,
68  259,
69  260,
70  261,
71  262,
72  263,
73  265,
74  266,
75  267,
76  268,
77  269,
78  270,
79  274,
80  275,
81  281,
82  282,
83  283,
84  284,
85  285,
86  286,
87  300,
88  301,
89  302,
90  303,
91  304,
92  305,
93  306,
94  307,
95  308,
96  309,
97  310,
98  311,
99  312,
100  313,
101  314,
102  315,
103  316,
104  317,
105  318,
106  319,
107  320,
108  321,
109  322,
110  323,
111  325,
112  326,
113  327,
114  328,
115  329,
116  330,
117  331,
118  332,
119  333,
120  334,
121  335,
122  336,
123  337,
124  338,
125  339,
126  340,
127  341,
128  342,
129  343,
130  344,
131  345,
132  346,
133  347,
134  348,
135  349,
136  350,
137  351,
138  352,
139  355,
140  356,
141  357,
142  358,
143  359,
144  370,
145  371,
146  372,
147  373,
148  374,
149  375,
150  376,
151  377,
152  378,
153  381,
154  382
155];
156
157export const onlyArkts2SyntaxRules: Map<number, string> = new Map([
158  [1, 'arkts-identifiers-as-prop-names'],
159  [25, 'arkts-no-ctor-prop-decls'],
160  [29, 'arkts-no-props-by-index'],
161  [30, 'arkts-no-structural-typing'],
162  [34, 'arkts-no-inferred-generic-params'],
163  [37, 'arkts-no-regexp-literals'],
164  [111, 'arkts-no-enum-mixed-types'],
165  [137, 'arkts-no-globalthis'],
166  [139, 'arkts-no-func-props'],
167  [140, 'arkts-no-func-bind'],
168  [141, 'arkts-limited-stdlib'],
169  [149, 'arkts-no-classes-as-obj'],
170  [183, 'arkts-obj-literal-props'],
171  [184, 'arkts-optional-methods'],
172  [189, 'arkts-numeric-semantic'],
173  [190, 'arkts-incompatible-function-types'],
174  [191, 'arkts-no-need-stdlib-ason'],
175  [192, 'arkts-limited-void-type'],
176  [193, 'arkts-no-void-operator'],
177  [198, 'arkts-no-ts-overload'],
178  [202, 'arkts-limited-literal-types'],
179  [203, 'arkts-no-exponent-op'],
180  [207, 'arkts-no-arguments-obj'],
181  [208, 'arkts-no-tagged-templates'],
182  [209, 'arkts-array-index-expr-type'],
183  [210, 'arkts-switch-expr'],
184  [211, 'arkts-case-expr'],
185  [212, 'arkts-array-index-negative'],
186  [222, 'arkts-no-side-effect-import'],
187  [232, 'arkts-no-lazy-import'],
188  [233, 'arkts-no-dynamic-import'],
189  [234, 'arkts-no-ts-decorators'],
190  [235, 'arkts-common-union-member-access'],
191  [236, 'arkts-no-method-overriding-field'],
192  [237, 'arkts-no-tuples-arrays'],
193  [238, 'arkts-class-static-initialization'],
194  [239, 'arkts-invalid-identifier'],
195  [255, 'arkts-no-extends-expression'],
196  [300, 'arkts-no-ts-like-function-call'],
197  [301, 'arkts-ohmurl-full-path'],
198  [304, 'arkts-no-duplicate-function-name'],
199  [319, 'arkts-method-inherit-rule'],
200  [325, 'arkts-default-args-behind-required-args'],
201  [329, 'arkts-unsupport-prop-name-from-value'],
202  [370, 'arkts-no-sparse-array'],
203  [371, 'arkts-no-enum-prop-as-type'],
204  [372, 'arkts-no-ts-like-smart-type'],
205  [373, 'arkts-array-type-immutable'],
206  [374, 'arkts-primitive-type-normalization'],
207  [375, 'arkts-no-ts-like-catch-type'],
208  [376, 'arkts-numeric-bigint-compare'],
209  [377, 'arkts-only-support-decimal-bigint-literal'],
210  [378, 'arkts-unsupport-operator']
211]);
212