• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2022 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 */
15const fs = require('fs');
16const path = require('path');
17const ExcelJS = require('exceljs');
18const cm = require('comment-parser');
19function requireTypescriptModule() {
20  const buildOption = require('./build.json');
21  if (buildOption.isBundle) {
22    return require('typescript');
23  }
24  const tsPathArray = [
25    path.resolve(__dirname, '../node_modules/typescript'),
26    path.resolve(__dirname, '../../node_modules/typescript')
27  ];
28  if (fs.existsSync(tsPathArray[0])) {
29    return require(tsPathArray[0]);
30  } else if (fs.existsSync(tsPathArray[1])) {
31    return require(tsPathArray[1]);
32  }
33  return null;
34}
35exports.requireTypescriptModule = requireTypescriptModule;
36const ts = requireTypescriptModule();
37
38const commentNodeWhiteList = [
39  ts.SyntaxKind.PropertySignature, ts.SyntaxKind.CallSignature, ts.SyntaxKind.MethodSignature,
40  ts.SyntaxKind.MethodDeclaration, ts.SyntaxKind.EnumMember, ts.SyntaxKind.VariableStatement,
41  ts.SyntaxKind.PropertyDeclaration, ts.SyntaxKind.Constructor, ts.SyntaxKind.ModuleDeclaration,
42  ts.SyntaxKind.NamespaceExportDeclaration, ts.SyntaxKind.ClassDeclaration, ts.SyntaxKind.InterfaceDeclaration,
43  ts.SyntaxKind.EnumDeclaration, ts.SyntaxKind.Parameter, ts.SyntaxKind.TypeLiteral, ts.SyntaxKind.FunctionDeclaration,
44  ts.SyntaxKind.LabeledStatement, ts.SyntaxKind.TypeAliasDeclaration
45];
46exports.commentNodeWhiteList = commentNodeWhiteList;
47
48const tagsArrayOfOrder = [
49  'namespace', 'struct', 'extends', 'implements', 'typedef', 'interface', 'permission', 'enum', 'constant', 'type',
50  'param', 'default', 'returns', 'readonly', 'throws', 'static', 'fires', 'syscap', 'systemapi', 'famodelonly',
51  'FAModelOnly', 'stagemodelonly', 'StageModelOnly', 'crossplatform', 'form', 'atomicservice', 'since', 'deprecated',
52  'useinstead', 'test', 'form', 'example'
53];
54exports.tagsArrayOfOrder = tagsArrayOfOrder;
55
56const fileTagOrder = ['file', 'kit'];
57exports.fileTagOrder = fileTagOrder;
58
59function getAPINote(node) {
60  const apiLength = node.getText().length;
61  const apiFullLength = node.getFullText().length;
62  return node.getFullText().substring(0, apiFullLength - apiLength);
63}
64exports.getAPINote = getAPINote;
65
66function hasAPINote(node) {
67  if (!node) {
68    return false;
69  }
70  const apiNote = getAPINote(node).replace(/[\s]/g, '');
71  if (apiNote && apiNote.length !== 0) {
72    return true;
73  }
74  return false;
75}
76exports.hasAPINote = hasAPINote;
77
78function removeDir(url) {
79  const statObj = fs.statSync(url);
80  if (statObj.isDirectory()) {
81    let dirs = fs.readdirSync(url);
82    dirs = dirs.map(dir => path.join(url, dir));
83    for (let i = 0; i < dirs.length; i++) {
84      removeDir(dirs[i]);
85    }
86    fs.rmdirSync(url);
87  } else {
88    fs.unlinkSync(url);
89  }
90}
91exports.removeDir = removeDir;
92
93function writeResultFile(resultData, outputPath, option) {
94  const STANDARD_INDENT = 2;
95  fs.writeFile(path.resolve(__dirname, outputPath), JSON.stringify(resultData, null, STANDARD_INDENT), option, err => {
96    if (err) {
97      console.error(`ERROR FOR CREATE FILE:${err}`);
98    } else {
99      console.log('API CHECK FINISH!');
100    }
101  });
102}
103exports.writeResultFile = writeResultFile;
104
105function overwriteIndexOf(item, array) {
106  const indexArr = [];
107  for (let i = 0; i < array.length; i++) {
108    if (array[i] === item) {
109      indexArr.push(i);
110    }
111  }
112  return indexArr;
113}
114exports.overwriteIndexOf = overwriteIndexOf;
115
116const ErrorType = {
117  UNKNOW_DECORATOR: {
118    id: 0,
119    description: 'unknow decorator',
120  },
121  MISSPELL_WORDS: {
122    id: 1,
123    description: 'misspell words',
124  },
125  NAMING_ERRORS: {
126    id: 2,
127    description: 'naming errors',
128  },
129  UNKNOW_PERMISSION: {
130    id: 3,
131    description: 'unknow permission',
132  },
133  UNKNOW_SYSCAP: {
134    id: 4,
135    description: 'unknow syscap',
136  },
137  UNKNOW_DEPRECATED: {
138    id: 5,
139    description: 'unknow deprecated',
140  },
141  WRONG_ORDER: {
142    id: 6,
143    description: 'wrong order',
144  },
145  WRONG_VALUE: {
146    id: 7,
147    description: 'wrong value',
148  },
149  WRONG_SCENE: {
150    id: 8,
151    description: 'wrong scene',
152  },
153  PARAMETER_ERRORS: {
154    id: 9,
155    description: 'wrong parameter',
156  },
157  API_PAIR_ERRORS: {
158    id: 10,
159    description: 'limited api pair errors',
160  },
161  ILLEGAL_ANY: {
162    id: 11,
163    description: 'illegal any',
164  },
165  API_CHANGE_ERRORS: {
166    id: 12,
167    description: 'api change errors',
168  },
169};
170exports.ErrorType = ErrorType;
171
172const LogType = {
173  LOG_API: 'Api',
174  LOG_JSDOC: 'JsDoc',
175  LOG_FILE: 'File',
176};
177exports.LogType = LogType;
178
179const ErrorLevel = {
180  HIGH: 3,
181  MIDDLE: 2,
182  LOW: 1,
183};
184exports.ErrorLevel = ErrorLevel;
185
186const FileType = {
187  API: 'Api',
188  JSDOC: 'JsDoc',
189};
190exports.FileType = FileType;
191
192const apiCheckArr = [];
193exports.apiCheckArr = apiCheckArr;
194
195const apiCheckInfoArr = [];
196exports.apiCheckInfoArr = apiCheckInfoArr;
197
198class ApiCheckResultClass {
199  formatCheckResult = true;
200}
201exports.ApiCheckResult = new ApiCheckResultClass();
202
203async function excelApiCheckResult(apiCheckArr) {
204  const workbook = new ExcelJS.Workbook();
205  const sheet = workbook.addWorksheet('Js Api', { views: [{ xSplit: 1 }] });
206  sheet.getRow(1).values = ['order', 'errorType', 'fileName', 'apiName', 'apiContent', 'type', 'errorInfo', 'version', 'model'];
207  for (let i = 1; i <= apiCheckArr.length; i++) {
208    const apiData = apiCheckArr[i - 1];
209    sheet.getRow(i + 1).values = [i, apiData.errorType, apiData.fileName, apiData.apiName, apiData.apiFullText,
210      apiData.type, apiData.errorInfo, apiData.version, apiData.basename];
211  }
212  const buffer = await workbook.xlsx.writeBuffer();
213  fs.writeFile('Js_Api.xlsx', buffer, function (err) {
214    if (err) {
215      console.error(err);
216      return;
217    }
218  });
219  return buffer;
220}
221exports.excelApiCheckResult = excelApiCheckResult;
222
223function getApiInfo(node) {
224  const notesStr = getAPINote(node);
225  const apiInfo = {};
226  const versionArr = [];
227  if (notesStr !== '') {
228    if (/\@systemapi/g.test(notesStr)) {
229      apiInfo.isSystemApi = 'system api';
230    }
231    if (/\@constant/g.test(notesStr)) {
232      apiInfo.isConstant = true;
233    }
234    if (/\@since\s*(\d+)/g.test(notesStr)) {
235      notesStr.replace(/\@since\s*(\d+)/g, (versionInfo) => {
236        versionArr.push(versionInfo);
237        apiInfo.version = versionInfo.replace(/\@since/g, '').trim();
238      });
239      apiInfo.humpVersion = versionArr[0].replace(/\@since/g, '').trim();
240    }
241    if (/\@deprecated.*since\s*(\d+)/g.test(notesStr)) {
242      notesStr.replace(/\@deprecated.*since\s*(\d+)/g,
243        versionInfo => {
244          apiInfo.deprecated = versionInfo.replace(
245            /\@deprecated.*since\s*/g, '').trim();
246        });
247    }
248    if (/\@famodelonly/g.test(notesStr)) {
249      notesStr.replace(/\@famodelonly/g, modelInfo => {
250        apiInfo.model = modelInfo;
251      });
252    } else if (/\@stagemodelonly/g.test(notesStr)) {
253      notesStr.replace(/\@stagemodelonly/g, modelInfo => {
254        apiInfo.model = modelInfo;
255      });
256    }
257    if (/\@syscap\s*((\w|\.|\/|\{|\@|\}|\s)+)/g.test(notesStr)) {
258      notesStr.replace(/\@syscap\s*((\w|\.|\/|\{|\@|\}|\s)+)/g, sysCapInfo => {
259        apiInfo.sysCap = sysCapInfo.replace(/\@syscap/g, '').trim();
260      });
261    }
262    if (/\@permission\s*((\w|\.|\/|\{|\@|\}|\s)+)/g.test(notesStr)) {
263      notesStr.replace(/\@permission\s*((\w|\.|\/|\{|\@|\}|\s)+)/g,
264        permissionInfo => {
265          apiInfo.permission =
266            permissionInfo.replace(/\@permission/g, '').trim();
267        });
268    }
269  }
270  return apiInfo;
271}
272exports.getApiInfo = getApiInfo;
273
274function getApiVersion(node) {
275  if (getApiInfo(node).humpVersion) {
276    return getApiInfo(node).humpVersion;
277  } else if (node.parent && !ts.isSourceFile(node.parent)) {
278    return getApiVersion(node.parent);
279  } else {
280    return 'NA';
281  }
282}
283exports.getApiVersion = getApiVersion;
284
285function parseJsDoc(node) {
286  if (!hasAPINote(node)) {
287    return [];
288  } else {
289    return cm.parse(getAPINote(node));
290  }
291}
292exports.parseJsDoc = parseJsDoc;
293
294function getDeclareValue(declareValue) {
295  let apiDeclareValue = '';
296  if (!declareValue) {
297    return apiDeclareValue;
298  }
299  if (ts.isFunctionTypeNode(declareValue)) {
300    apiDeclareValue = 'Function';
301  } else if (ts.isTypeLiteralNode(declareValue)) {
302    apiDeclareValue = 'object';
303  } else {
304    apiDeclareValue = declareValue.getText().replace(/\n|\r|\s/g, '');
305  }
306  return apiDeclareValue;
307}
308exports.getDeclareValue = getDeclareValue;
309
310const systemPermissionFile = path.resolve(__dirname, '../../../../../',
311  'base/global/system_resources/systemres/main/module.json');
312
313exports.systemPermissionFile = systemPermissionFile;
314
315exports.checkOption = {
316  permissionContent: undefined,
317};
318
319const inheritArr = ['test', 'famodelonly', 'FAModelOnly', 'stagemodelonly', 'StageModelOnly', 'deprecated',
320  'systemapi'];
321exports.inheritArr = inheritArr;
322
323const ErrorValueInfo = {
324  ERROR_INFO_VALUE_EXTENDS: 'the [extends] tag value is incorrect. Please check if the tag value matches the inherited class name.',
325  ERROR_INFO_VALUE_ENUM: 'the [enum] tag type is incorrect. Please check if the tag type is { string } or { number }',
326  ERROR_INFO_VALUE_SINCE: 'the [since] tag value is incorrect. Please check if the tag value is a numerical value',
327  ERROR_INFO_RETURNS: 'the [returns] tag was used incorrectly. The returns tag should not be used when the return type is void',
328  ERROR_INFO_VALUE_RETURNS: 'the [returns] tag type is incorrect. Please check if the tag type is consistent with the return type',
329  ERROR_INFO_VALUE_USEINSTEAD: 'the [useinstead] tag value is incorrect. Please check the usage method',
330  ERROR_INFO_VALUE_TYPE: 'the [type] tag type is incorrect. Please check if the type matches the attribute type',
331  ERROR_INFO_VALUE_DEFAULT: 'the [default] tag value is incorrect. Please supplement the default value',
332  ERROR_INFO_VALUE_PERMISSION: 'the [permission] tag value is incorrect. Please check if the permission field has been configured or update the configuration file',
333  ERROR_INFO_VALUE_DEPRECATED: 'the [deprecated] tag value is incorrect. Please check the usage method',
334  ERROR_INFO_VALUE_SYSCAP: 'the [syscap] tag value is incorrect. Please check if the syscap field is configured',
335  ERROR_INFO_VALUE_NAMESPACE: 'the [namespace] tag value is incorrect. Please check if it matches the namespace name',
336  ERROR_INFO_VALUE_INTERFACE: 'the [interface] label value is incorrect. Please check if it matches the interface name',
337  ERROR_INFO_VALUE_TYPEDEF: 'the [typedef] tag value is incorrect. Please check if it matches the interface name',
338  ERROR_INFO_TYPE_PARAM: 'the type of the [$$] [param] tag is incorrect. Please check if it matches the type of the [$$] parameter',
339  ERROR_INFO_VALUE_PARAM: 'the value of the [$$] [param] tag is incorrect. Please check if it matches the [$$] parameter name',
340  ERROR_INFO_VALUE1_THROWS: 'the type of the [$$] [throws] tag is incorrect. Please fill in [BusinessError]',
341  ERROR_INFO_VALUE2_THROWS: 'the type of the [$$] [throws] tag is incorrect. Please check if the tag value is a numerical value',
342  ERROR_INFO_INHERIT: 'it was detected that there is an inheritable label [$$] in the current file, but there are child nodes without this label',
343  ERROR_ORDER: 'JSDoc label order error, please make adjustments',
344  ERROR_LABELNAME: 'the [$$] tag does not exist. Please use a valid JSDoc tag',
345  ERROR_LOST_LABEL: 'JSDoc tag validity verification failed. Please confirm if the [$$] tag is missing',
346  ERROR_USE: 'JSDoc label validity verification failed. The [$$] label is not allowed. Please check the label usage method.',
347  ERROR_MORELABEL: 'JSDoc tag validity verification failed. The [$$] [$$] tag is redundant. Please check if the tag should be deleted.',
348  ERROR_REPEATLABEL: 'the validity verification of the JSDoc tag failed. The [$$] tag is not allowed to be reused, please delete the extra tags',
349  ERROR_USE_INTERFACE: 'the validity verification of the JSDoc tag failed. The [interface] tag and [typedef] tag are not allowed to be used simultaneously. Please confirm the interface class.',
350  ERROR_EVENT_NAME_STRING: 'The event name should be string.',
351  ERROR_EVENT_NAME_NULL: 'The event name cannot be Null value.',
352  ERROR_EVENT_NAME_SMALL_HUMP: 'The event name should be named by small hump. (Received [\'$$\'])',
353  ERROR_EVENT_CALLBACK_OPTIONAL: 'The callback parameter of off function should be optional.',
354  ERROR_EVENT_CALLBACK_MISSING: 'The off functions of one single event should have at least one callback parameter, and the callback parameter should be the last parameter.',
355  ERROR_EVENT_ON_AND_OFF_PAIR: 'The on and off event subscription methods do not appear in pair.',
356  ILLEGAL_USE_ANY: 'Illegal [any] keyword used in the API',
357  ERROR_CHANGES_VERSION: 'Please check if the changed API version number is $$.',
358  ERROR_CHANGES_API_HISTORY_PARAM_REQUIRED_CHANGE: 'Forbid changes: Optional parameters cannot be changed to required parameters.',
359  ERROR_CHANGES_API_HISTORY_PARAM_RANGE_CHANGE: 'Forbid changes: Parameters type range cannot be reduced.',
360  ERROR_CHANGES_API_HISTORY_PARAM_WITHOUT_TYPE_CHANGE: 'Forbid changes: Parameters Parameter must be defined by type.',
361  ERROR_CHANGES_API_HISTORY_PARAM_TYPE_CHANGE: 'Forbid changes: Parameters type cannot be modified.',
362  ERROR_CHANGES_API_HISTORY_PARAM_POSITION_CHANGE: 'Forbid changes: Parameters position not be allowed to be modified.',
363  ERROR_CHANGES_API_NEW_REQUIRED_PARAM: 'Forbid changes: Required parameters cannot be created.',
364  ERROR_CHANGES_API_DELETE_PARAM: 'Forbid changes: Parameters cannot be deleted.',
365  ERROR_CHANGES_DEPRECATED: 'Forbid changes: The api has deprecated tag.',
366  ERROR_CHANGES_JSDOC_NUMBER: 'Forbid changes: API changes must add a new section of JSDoc.',
367  ERROR_CHANGES_JSDOC_CHANGE: 'Forbid changes: Previous JSDoc cannot be changed.',
368  ERROR_CHANGES_JSDOC_TRROWS: 'Forbid changes: Throws tag cannot be created.',
369  ERROR_CHANGES_JSDOC_PERMISSION: 'Forbid changes: Permission tag cannot be created or modified.',
370  ERROR_FILE_TAG_ORDER: 'File tags order is incorrect.',
371  ERROR_DESCRIPTION_NULL: 'description is null',
372  ERROR_HAS_CHINESE: 'has chinese'
373};
374exports.ErrorValueInfo = ErrorValueInfo;
375
376const DIFF_INFO = {
377  NEW_JSDOCS_LENGTH: 1,
378  NEW_JSDOC_INDEX: 2,
379};
380exports.DIFF_INFO = DIFF_INFO;
381
382/**
383 * link error message
384 */
385function createErrorInfo(errorInfo, params) {
386  params.forEach((param) => {
387    errorInfo = errorInfo.replace('$$', param);
388  });
389  return errorInfo;
390}
391exports.createErrorInfo = createErrorInfo;
392
393/**
394 * judge if it is an API file for Arkui
395 */
396function isArkUIApiFile(fileName) {
397  if (fileName.indexOf('component\\ets\\') >= 0 || fileName.indexOf('component/ets/') >= 0) {
398    return true;
399  }
400  return false;
401}
402exports.isArkUIApiFile = isArkUIApiFile;
403
404function isWhiteListFile(fileName, whiteList) {
405  for (let i = 0; i < whiteList.length; i++) {
406    if (path.normalize(fileName).indexOf(path.normalize(whiteList[i])) !== -1) {
407      return true;
408    }
409  }
410  return false;
411}
412exports.isWhiteListFile = isWhiteListFile;
413
414function getCheckApiVersion() {
415  const packageJsonPath = path.join(__dirname, '../package.json');
416  let packageJson;
417  let checkApiVersion;
418  try {
419    const packageJsonContent = fs.readFileSync(packageJsonPath, 'utf8');
420    packageJson = JSON.parse(packageJsonContent);
421    checkApiVersion = packageJson.checkApiVersion;
422  } catch (error) {
423    throw `Failed to read package.json or parse JSON content: ${error}`;
424  }
425  if (!checkApiVersion) {
426    throw 'Please configure the correct API version to be verified';
427  }
428  return checkApiVersion;
429}
430exports.getCheckApiVersion = getCheckApiVersion;
431
432const OptionalSymbols = {
433  QUERY: '?',
434  LEFT_BRACKET: '[',
435  RIGHT_BRACKET: ']',
436  LEFT_BRACE: '{',
437  RIGHT_BRACE: '}',
438  LEFT_PARENTHESES: '(',
439  RIGHT_PARENTHESES: ')'
440};
441exports.OptionalSymbols = OptionalSymbols;
442
443function removeDuplicateObj(array) {
444  const newArr = [];
445  const errorInfoSet = new Set();
446  for (const errorInfo of array) {
447    if (!errorInfoSet.has(JSON.stringify(errorInfo))) {
448      errorInfoSet.add(JSON.stringify(errorInfo));
449      newArr.push(errorInfo);
450    }
451  }
452  return newArr;
453};
454exports.removeDuplicateObj = removeDuplicateObj;
455
456// check the api version
457function checkVersionNeedCheck(node) {
458  const apiVersion = getApiVersion(node);
459  const apiCheckVersion = getCheckApiVersion();
460  if (parseInt(apiVersion) >= parseInt(apiCheckVersion)) {
461    return true;
462  }
463  return false;
464}
465exports.checkVersionNeedCheck = checkVersionNeedCheck;
466
467const FUNCTION_TYPES = [ts.SyntaxKind.FunctionDeclaration, ts.SyntaxKind.MethodSignature,
468ts.SyntaxKind.MethodDeclaration, ts.SyntaxKind.CallSignature, ts.SyntaxKind.Constructor];
469exports.FUNCTION_TYPES = FUNCTION_TYPES;
470
471function splitPath(filePath, pathElements) {
472  let spliteResult = path.parse(filePath);
473  if (spliteResult.base !== '') {
474    pathElements.add(spliteResult.base);
475    splitPath(spliteResult.dir, pathElements);
476  }
477}
478exports.splitPath = splitPath;
479
480function isAscending(arr) {
481  for (let i = 1; i < arr.length; i++) {
482    if (arr[i] < arr[i - 1]) {
483      return false;
484    }
485  }
486  return true;
487}
488exports.isAscending = isAscending;
489
490const ruleArr = ['API_DOC_ATOMICSERVICE_01',
491  'API_DOC_ATOMICSERVICE_02',
492  'API_DOC_CONSTANT_01',
493  'API_DOC_CONSTANT_02',
494  'API_DOC_CONSTANT_03',
495  'API_DOC_CONSTANT_04',
496  'API_DOC_CROSSPLATFORM_01',
497  'API_DOC_CROSSPLATFORM_02',
498  'API_DOC_DEFAULT_01',
499  'API_DOC_DEFAULT_02',
500  'API_DOC_DEFAULT_04',
501  'API_DOC_DEPRECATED_01',
502  'API_DOC_DEPRECATED_02',
503  'API_DOC_DEPRECATED_03',
504  'API_DOC_DEPRECATED_04',
505  'API_DOC_ENUM_01',
506  'API_DOC_ENUM_02',
507  'API_DOC_ENUM_03',
508  'API_DOC_ENUM_04',
509  'API_DOC_ENUM_05',
510  'API_DOC_EXAMPLE_01',
511  'API_DOC_EXAMPLE_02',
512  'API_DOC_EXTENDS_01',
513  'API_DOC_EXTENDS_02',
514  'API_DOC_EXTENDS_03',
515  'API_DOC_EXTENDS_04',
516  'API_DOC_EXTENDS_05',
517  'API_DOC_FAMODELONLY_01',
518  'API_DOC_FAMODELONLY_02',
519  'API_DOC_FAMODELONLY_03',
520  'API_DOC_FIRES_01',
521  'API_DOC_FIRES_02',
522  'API_DOC_FORM_01',
523  'API_DOC_FORM_02',
524  'API_DOC_IMPLEMENTS_01',
525  'API_DOC_IMPLEMENTS_04',
526  'API_DOC_INTERFACE_04',
527  'API_DOC_INTERFACE_05',
528  'API_DOC_NAMESPACE_01',
529  'API_DOC_NAMESPACE_02',
530  'API_DOC_NAMESPACE_03',
531  'API_DOC_NAMESPACE_04',
532  'API_DOC_NAMESPACE_05',
533  'API_DOC_PARAM_01',
534  'API_DOC_PARAM_02',
535  'API_DOC_PARAM_03',
536  'API_DOC_PARAM_04',
537  'API_DOC_PARAM_05',
538  'API_DOC_PARAM_06',
539  'API_DOC_PERMISSION_02',
540  'API_DOC_PERMISSION_04',
541  'API_DOC_READONLY_01',
542  'API_DOC_READONLY_02',
543  'API_DOC_READONLY_03',
544  'API_DOC_RETURNS_01',
545  'API_DOC_RETURNS_02',
546  'API_DOC_RETURNS_03',
547  'API_DOC_RETURNS_04',
548  'API_DOC_RETURNS_05',
549  'API_DOC_RETURNS_06',
550  'API_DOC_SINCE_01',
551  'API_DOC_SINCE_02',
552  'API_DOC_SINCE_03',
553  'API_DOC_SINCE_04',
554  'API_DOC_STAGEMODELONLY_01',
555  'API_DOC_STAGEMODELONLY_02',
556  'API_DOC_STAGEMODELONLY_03',
557  'API_DOC_STATIC_01',
558  'API_DOC_STATIC_02',
559  'API_DOC_STRUCT_02',
560  'API_DOC_STRUCT_05',
561  'API_DOC_SYSCAP_02',
562  'API_DOC_SYSCAP_03',
563  'API_DOC_SYSCAP_04',
564  'API_DOC_SYSTEMAPI_01',
565  'API_DOC_SYSTEMAPI_02',
566  'API_DOC_SYSTEMAPI_03',
567  'API_DOC_TEST_01',
568  'API_DOC_TEST_02',
569  'API_DOC_TEST_03',
570  'API_DOC_THROWS_01',
571  'API_DOC_THROWS_02',
572  'API_DOC_THROWS_03',
573  'API_DOC_TYPE_01',
574  'API_DOC_TYPE_02',
575  'API_DOC_TYPE_03',
576  'API_DOC_TYPE_05',
577  'API_DOC_TYPEDEF_01',
578  'API_DOC_TYPEDEF_02',
579  'API_DOC_TYPEDEF_03',
580  'API_DOC_TYPEDEF_04',
581  'API_DOC_TYPEDEF_05',
582  'API_DOC_USEINSTEAD_01',
583  'API_DOC_USEINSTEAD_02',
584  'API_DOC_USEINSTEAD_03',
585  'API_DOC_USEINSTEAD_04',
586  'API_DOC_UNKNOW_DECORATOR_01',
587  'API_DEFINE_UNALLOWABLE_01',
588  'API_DEFINE_NAME_01',
589  'API_DEFINE_NAME_02',
590  'API_DEFINE_SPELLING_01',
591  'API_DEFINE_EVENT_01',
592  'API_DEFINE_EVENT_02',
593  'API_DEFINE_EVENT_03',
594  'API_DEFINE_EVENT_04',
595  'API_DEFINE_EVENT_05',
596  'API_DEFINE_EVENT_06',
597  'API_DEFINE_EVENT_07',
598  'API_DEFINE_EVENT_08',
599  'API_DEFINE_HUMP_01',
600  'API_DEFINE_HUMP_02',
601  'API_DEFINE_HUMP_03',
602  'API_DEFINE_HUMP_04',
603  'API_DEFINE_HUMP_05',
604  'API_CHANGE_INCOMPATIBLE_01',
605  'API_CHANGE_INCOMPATIBLE_02',
606  'API_CHANGE_INCOMPATIBLE_03',
607  'API_CHANGE_INCOMPATIBLE_04',
608  'API_CHANGE_INCOMPATIBLE_05',
609  'API_CHANGE_INCOMPATIBLE_06',
610  'API_CHANGE_INCOMPATIBLE_07',
611  'API_CHANGE_INCOMPATIBLE_08',
612  'API_CHANGE_INCOMPATIBLE_09',
613  'API_CHANGE_INCOMPATIBLE_10',
614  'API_CHANGE_INCOMPATIBLE_11',
615  'API_CHANGE_INCOMPATIBLE_12',
616  'API_CHANGE_INCOMPATIBLE_13',
617  'API_CHANGE_INCOMPATIBLE_14',
618  'API_CHANGE_INCOMPATIBLE_15',
619  'API_CHANGE_INCOMPATIBLE_16',
620  'API_CHANGE_INCOMPATIBLE_17',
621  'API_CHANGE_INCOMPATIBLE_18',
622  'API_CHANGE_INCOMPATIBLE_19',
623  'API_CHANGE_INCOMPATIBLE_20',
624  'API_CHANGE_INCOMPATIBLE_21',
625  'API_CHANGE_INCOMPATIBLE_22',
626  'API_CHANGE_INCOMPATIBLE_23',
627  'API_CHANGE_INCOMPATIBLE_24',
628  'API_CHANGE_INCOMPATIBLE_25',
629  'API_CHANGE_INCOMPATIBLE_26',
630  'API_CHANGE_INCOMPATIBLE_27',
631  'API_CHANGE_INCOMPATIBLE_28',
632  'API_CHANGE_INCOMPATIBLE_29',
633  'API_CHANGE_INCOMPATIBLE_30',
634  'API_CHANGE_INCOMPATIBLE_31',
635  'API_CHANGE_INCOMPATIBLE_33',
636  'API_CHANGE_INCOMPATIBLE_34',
637  'API_CHANGE_INCOMPATIBLE_35',
638  'API_CHANGE_INCOMPATIBLE_36',
639  'API_CHANGE_INCOMPATIBLE_37',
640  'API_CHANGE_INCOMPATIBLE_38',
641  'API_CHANGE_INCOMPATIBLE_39',
642  'API_CHANGE_INCOMPATIBLE_40',
643  'API_CHANGE_INCOMPATIBLE_41',
644  'API_DOC_JSDOC_04'
645];
646exports.ruleArr = ruleArr;
647
648