You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows Admin Center扩展环境搭建失败:缺失ESLint配置文件

Windows Admin Center扩展编译失败:缺失ESLint配置问题解决办法

你遇到的问题是Windows Admin Center SDK模板文件缺失.eslintrc.json,导致项目创建时复制失败,后续gulp build的lint任务找不到配置文件。以下是具体解决步骤:

方法一:补全适配Angular 11的ESLint配置

空白配置无法满足Angular 11的lint规则要求,需要添加对应版本的标准配置:

  1. 在项目根目录创建.eslintrc.json,内容如下:
{
  "root": true,
  "ignorePatterns": ["projects/**/*"],
  "overrides": [
    {
      "files": ["*.ts"],
      "parserOptions": {
        "project": ["tsconfig.json", "e2e/tsconfig.json"],
        "createDefaultProgram": true
      },
      "extends": [
        "plugin:@angular-eslint/recommended",
        "plugin:@angular-eslint/template/process-inline-templates"
      ],
      "rules": {
        "@angular-eslint/component-selector": [
          "error",
          { "prefix": "app", "style": "kebab-case", "type": "element" }
        ],
        "@angular-eslint/directive-selector": [
          "error",
          { "prefix": "app", "style": "camelCase", "type": "attribute" }
        ]
      }
    },
    {
      "files": ["*.html"],
      "extends": ["plugin:@angular-eslint/template/recommended"],
      "rules": {}
    }
  ]
}
  1. 在项目的src目录下创建.eslintrc.json,内容如下:
{
  "extends": "../.eslintrc.json",
  "ignorePatterns": ["!**/*"]
}
  1. 安装项目本地依赖(全局依赖无法被gulp任务识别):
cd thot-manager
npm install --save-dev @angular-eslint/eslint-plugin @angular-eslint/eslint-plugin-template @angular-eslint/template-parser eslint eslint-plugin-import eslint-plugin-jsdoc eslint-plugin-prefer-arrow
  1. 重新执行编译:
gulp build

方法二:直接禁用ESLint检查任务

如果不需要代码检查,可以跳过lint步骤:

  1. 打开项目根目录的gulpfile.js,找到lintApp任务代码块,直接注释或删除该任务。
  2. 重新执行gulp build即可。

内容的提问来源于stack exchange,提问作者Fabien

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 08:27:35