Files
Saul Moro f19f9de23a ci(lint): enable type-aware linting with no-floating-promises and no-misused-promises (#836) (#863)
* ci(lint): enable type-aware linting with no-floating-promises and no-misused-promises

tsc does not report a promise nobody awaits or an async callback handed to an
API that ignores its result. In a CLI that is an error nobody sees. oxlint's
--type-aware mode checks both through oxlint-tsgolint.

- package.json: add oxlint-tsgolint 7.0.2003 (oxlint 1.85.0 needs
  >=7.0.2001) and pass --type-aware to `npm run lint`. The package ships
  prebuilt binaries as optional dependencies with no install script, so CI's
  `npm ci --ignore-scripts` needs no change.
- .oxlintrc.json: turn on typescript/no-floating-promises and
  typescript/no-misused-promises. Under src/__tests__/**, no-misused-promises
  skips checksVoidReturn.arguments: vi.spyOn(fse, ...) types the spy from
  fs-extra's last overload, the callback one that returns void, so every
  correct async mockImplementation is flagged.
- --type-aware also turns on oxlint's default type-aware rules. The ones
  with hits on main stay off, since each is its own evaluation under #836.
  The rest of the defaults have no hits and stay on.

Fixes, all behavior-neutral:
- dashboard.ts: the SSE debounce and the PID check become named async
  functions called with `void`; both already catch everything they throw.
  The HTTP handler becomes handleRequest, and createServer catches its
  rejection, logs it and answers 500.
- import-repo-list.ts: track in-flight imports in a Set, so the unused array
  splice returned is gone.
- scripts/mock-teamai-server.mjs: same handler wrapper as the dashboard, so a
  malformed JSON body answers 500 instead of an unhandled rejection.
- ai-client.test.ts: schedule the mock process events with queueMicrotask.

Refs #836.

* ci(lint): turn on typescript/no-useless-default-assignment

1 prod hit, type-only: syncTeamUpdatesToLocal's last parameter was
`placedRules: Record<string, string> | undefined = undefined`; it is now
`placedRules?: Record<string, string>`.

Refs #836.

* ci(lint): list only the type-aware rules that would otherwise run as off

consistent-return, no-unnecessary-boolean-literal-compare,
no-unnecessary-type-arguments, no-unnecessary-type-assertion,
no-unnecessary-type-conversion, no-unnecessary-type-parameters and
no-unsafe-type-assertion are not default rules, so listing them as off
changed nothing. The config keeps off only the nine default type-aware rules that
--type-aware would turn on.
`oxlint --type-aware --print-config` gives the same set of active rules
before and after.

Refs #836.
2026-09-29 11:07:58 +08:00

100 lines
2.4 KiB
JSON

{
"name": "teamai-cli",
"version": "0.22.0",
"description": "TeamAI — Make Every Team AI Native (skill sync + shared knowledge base, powered by Git)",
"type": "module",
"bin": {
"teamai": "dist/index.js"
},
"files": [
"dist/**/*.js",
"skills",
"skill-data",
"!**/__pycache__",
"!**/*.pyc",
"agents",
"README.md",
"CHANGELOG.md",
"LICENSE"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"test": "vitest run",
"test:e2e": "vitest run --config vitest.e2e.config.ts",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware --deny-warnings --report-unused-disable-directives",
"release": "standard-version",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Tencent/teamai-cli.git"
},
"homepage": "https://github.com/Tencent/teamai-cli#readme",
"bugs": {
"url": "https://github.com/Tencent/teamai-cli/issues"
},
"keywords": [
"ai",
"team",
"devkit",
"skills",
"sharing"
],
"author": "jeffyxu <jeffyxu@tencent.com>",
"license": "MIT",
"dependencies": {
"chalk": "^5.3.0",
"commander": "^12.1.0",
"cross-spawn": "^7.0.6",
"fflate": "^0.8.3",
"fs-extra": "^11.2.0",
"gray-matter": "^4.0.3",
"listr2": "^9.0.5",
"ora": "^8.1.0",
"semver": "^7.8.5",
"simple-git": "^3.36.0",
"smol-toml": "^1.7.1",
"tree-sitter-wasms": "0.1.13",
"web-tree-sitter": "0.25.10",
"yaml": "^2.6.0",
"zod": "^3.24.0"
},
"overrides": {
"js-yaml": "^3.15.2",
"brace-expansion@1": "1.1.18",
"brace-expansion@2": "2.1.4",
"brace-expansion@5": "5.0.9",
"nanoid": "3.3.19",
"postcss": "8.5.28",
"picomatch": "4.0.7"
},
"devDependencies": {
"@types/cross-spawn": "^6.0.6",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.17.0",
"@types/semver": "^7.8.0",
"@vitest/coverage-v8": "^3.2.7",
"fast-check": "^4.10.2",
"opencode-ai": "1.18.23",
"oxlint": "1.85.0",
"oxlint-tsgolint": "7.0.2003",
"standard-version": "^9.5.0",
"tsup": "^8.3.0",
"typescript": "^5.7.0",
"vitest": "^3.2.7"
},
"main": "index.js",
"directories": {
"doc": "docs",
"example": "examples",
"test": "test"
}
}