Context
packages/backend.ai-client/package.json declares:
"lint": "eslint ./src --max-warnings=0",
"prepublishOnly": "pnpm lint && pnpm test && pnpm build"
There is no eslint.config.js (or any .eslintrc*) inside the package. Depending on how ESLint resolves config, the lint script either no-ops or picks up the repo root config and applies React/JSX rules that do not match a TypeScript-only library. Either way, prepublishOnly is currently giving a misleading green light.
Scope
- Add
packages/backend.ai-client/eslint.config.js (flat config, ESM)
- Use the shared
packages/eslint-config-bai if it has a non-React preset, otherwise extend @eslint/js + typescript-eslint directly
- Recommended initial rule set:
@typescript-eslint/recommended
@typescript-eslint/consistent-type-imports: error
no-floating-promises (or @typescript-eslint/no-floating-promises): error
@typescript-eslint/no-explicit-any: warn (kept as warn for now — strict typing pass is a separate ticket)
- Ignore
dist/, *.test.ts for the strict subset if needed
- Confirm
pnpm --filter backend.ai-client lint runs and reports honestly (warnings allowed but no errors)
Verification
pnpm --filter backend.ai-client lint exits 0 with the new config (after fixing only quick wins; any warnings expected)
bash scripts/verify.sh passes
- New errors introduced afterwards would actually fail
prepublishOnly
Out of scope
- Removing all
any (separate issue, large scope)
- Tightening
tsconfig.strict (separate issue)
JIRA Issue: FR-2790
Context
packages/backend.ai-client/package.jsondeclares:There is no
eslint.config.js(or any.eslintrc*) inside the package. Depending on how ESLint resolves config, the lint script either no-ops or picks up the repo root config and applies React/JSX rules that do not match a TypeScript-only library. Either way,prepublishOnlyis currently giving a misleading green light.Scope
packages/backend.ai-client/eslint.config.js(flat config, ESM)packages/eslint-config-baiif it has a non-React preset, otherwise extend@eslint/js+typescript-eslintdirectly@typescript-eslint/recommended@typescript-eslint/consistent-type-imports: errorno-floating-promises(or@typescript-eslint/no-floating-promises): error@typescript-eslint/no-explicit-any: warn (kept as warn for now — strict typing pass is a separate ticket)dist/,*.test.tsfor the strict subset if neededpnpm --filter backend.ai-client lintruns and reports honestly (warnings allowed but no errors)Verification
pnpm --filter backend.ai-client lintexits 0 with the new config (after fixing only quick wins;anywarnings expected)bash scripts/verify.shpassesprepublishOnlyOut of scope
any(separate issue, large scope)tsconfig.strict(separate issue)JIRA Issue: FR-2790