0.0.6 • Published 2 months ago

@afuteam-nx/plugin-exec-eslint v0.0.6

Weekly downloads
-
License
-
Repository
-
Last release
2 months ago

plugin-exec-eslint

对代码仓库执行代码质量检查,支持批量项目。 输出结果包含仓库的 eslint错误数 空行数 代码行数 注释行数 复杂度统计(不包含switchcase类型)

环境

本插件基于 nx 开发,请在对应初始化好的 your-app 中使用

本插件的输入文件建议使用 @afuteam-nx/plugin-add-eslint-type生成的文件

本插件受益于 @afuteam/eslint-plugin-fe 提供代码 eslint 规则

关于复杂度,使用了自定义的规则,过滤了 switch case 类型的统计

安装

pnpm i @afuteam-nx/plugin-exec-eslint -D

配置

# 在 apps/your-app/project.json 中配置
"targets": {
  "fetch-repos": {
    "executor": "@afuteam-nx/plugin-exec-eslint:run",
    "options": {
      "localFileReposWithAFULintTypePath": "项目清单需要有 AFULintType 字段, allProjectsWithLinType.json",
      "localAllReposCodePath": "本地的要执行 eslint 源代码路径",
      "resultPath": "结果输出路径 文件名 allProjectsLintResult.json"
    }
  }
}

使用

nx run your-app:exec-eslint

文件数据结构

allProjectsWithLinType.json

[
  {
    "id": 28612,
    "created_at": "2023-11-21T15:23:21.637+08:00",
    "last_activity_at": "2024-03-04T20:41:10.727+08:00",
    "name": "sky",
    "AFULintType": {
      "root": "react-ts"
    },
    "web_url": "https://gitlab.com/afuteam/sky"
  }
]

allProjectsLintResult.json

[
  {
    "sky": {
      "errors": 0,
      "warnings": 0,
      "total": 0,
      "blankLines": 589,
      "commentLines": 378,
      "codeLines": 21295,
      "complexityDataLength": 152,
      "created_at": "2023-11-21T15:23:21.637+08:00",
      "last_activity_at": "2024-03-04T20:41:10.727+08:00",
      "id": 28669,
      "name": "sky"
    }
  }
]
0.0.6

2 months ago

0.0.5

3 months ago

0.0.4

3 months ago

0.0.3

4 months ago

0.0.2

4 months ago

0.0.1

4 months ago