16e7c69efSopenharmony_ci/* 26e7c69efSopenharmony_ci * Copyright (c) 2022-2023 Huawei Device Co., Ltd. 36e7c69efSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 46e7c69efSopenharmony_ci * you may not use this file except in compliance with the License. 56e7c69efSopenharmony_ci * You may obtain a copy of the License at 66e7c69efSopenharmony_ci * 76e7c69efSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 86e7c69efSopenharmony_ci * 96e7c69efSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 106e7c69efSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 116e7c69efSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 126e7c69efSopenharmony_ci * See the License for the specific language governing permissions and 136e7c69efSopenharmony_ci * limitations under the License. 146e7c69efSopenharmony_ci */ 156e7c69efSopenharmony_ci 166e7c69efSopenharmony_ci{ 176e7c69efSopenharmony_ci "files": [ // 用于表示配置适用的文件范围的 glob 模式数组。在没有指定的情况下,应用默认配置 186e7c69efSopenharmony_ci "**/*.js", 196e7c69efSopenharmony_ci "**/*.ts", 206e7c69efSopenharmony_ci "**/*.ets", 216e7c69efSopenharmony_ci "**/*.js" 226e7c69efSopenharmony_ci ], 236e7c69efSopenharmony_ci "ignore": [ // 一个表示配置对象不应适用的文件的 glob 模式数组。如果没有指定,配置对象将适用于所有由 files 匹配的文件 246e7c69efSopenharmony_ci "**/.preview/**/*", 256e7c69efSopenharmony_ci "**/build/**/*", 266e7c69efSopenharmony_ci "**/oh_modules/**/*", 276e7c69efSopenharmony_ci "**/ohosTest/**/*", 286e7c69efSopenharmony_ci "**/node_modules/**/*", 296e7c69efSopenharmony_ci "**/hvigorfile.ts" 306e7c69efSopenharmony_ci ], 316e7c69efSopenharmony_ci "plugins": [ 326e7c69efSopenharmony_ci "@typescript-eslint" 336e7c69efSopenharmony_ci ], 346e7c69efSopenharmony_ci "ruleSet": [], 356e7c69efSopenharmony_ci "rules": { 366e7c69efSopenharmony_ci // 以下为codelinter工具默认配置 376e7c69efSopenharmony_ci "@typescript-eslint/await-thenable": "warn", 386e7c69efSopenharmony_ci "@typescript-eslint/explicit-function-return-type": "warn", // 函数返回值类型约束 396e7c69efSopenharmony_ci "@typescript-eslint/explicit-module-boundary-types": "warn", // 函数返回值类型约束 406e7c69efSopenharmony_ci "@typescript-eslint/no-dynamic-delete": "warn", 416e7c69efSopenharmony_ci "@typescript-eslint/no-explicit-any": "warn", 426e7c69efSopenharmony_ci "@typescript-eslint/no-for-in-array": "warn", 436e7c69efSopenharmony_ci "@typescript-eslint/no-this-alias": "warn", 446e7c69efSopenharmony_ci "@typescript-eslint/no-unnecessary-type-constraint": "warn", 456e7c69efSopenharmony_ci "@typescript-eslint/no-unsafe-argument": "warn", 466e7c69efSopenharmony_ci "@typescript-eslint/no-unsafe-assignment": "warn", 476e7c69efSopenharmony_ci "@typescript-eslint/no-unsafe-call": "warn", 486e7c69efSopenharmony_ci "@typescript-eslint/no-unsafe-member-access": "warn", 496e7c69efSopenharmony_ci "@typescript-eslint/no-unsafe-return": "warn", 506e7c69efSopenharmony_ci "@typescript-eslint/prefer-literal-enum-member": "warn", 516e7c69efSopenharmony_ci // 以下为自定义配置,off表示忽略该条规则 526e7c69efSopenharmony_ci "@typescript-eslint/consistent-type-imports": "off", // 忽略自动导入规则 536e7c69efSopenharmony_ci "@typescript-eslint/quotes": [ // 使用字符串单引号检测 546e7c69efSopenharmony_ci "warn", 556e7c69efSopenharmony_ci "single" 566e7c69efSopenharmony_ci ], 576e7c69efSopenharmony_ci "@typescript-eslint/no-empty-function": "warn", // 空函数体警告 586e7c69efSopenharmony_ci "@typescript-eslint/dot-notation": "warn" // 强制使用点符号访问对象属性,禁止使用[]方式访问属性 596e7c69efSopenharmony_ci }, 606e7c69efSopenharmony_ci "overrides": [] 616e7c69efSopenharmony_ci}