lint, format and quality:check all fail: package.json still points at config/*.js after the configs were migrated to .cjs
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 812
- Forks
- 175
- Avg merge
- 2m
- Merged PRs (30d)
- 3
Description
Summary
Three of the four documented quality commands fail immediately, all from one cause: a .cjs config migration happened and package.json was never updated. Every config file exists — under .cjs — while the scripts still reference .js.
| command | result |
|---|---|
npm run lint |
❌ exit 2 — cannot load config/.eslintrc.strict.js |
npm run format |
❌ exit 2 — Cannot find module '…/config/.prettierrc.js' |
npm run quality:check |
❌ exit 2 — dies on its first link (lint); nothing downstream runs |
npm run typecheck |
❌ exit 2 — works correctly, reporting the real errors from #213 |
Measured on a fresh --depth 1 clone of main + npm install, Node 24, macOS 15.6.
The cause
$ git ls-files config/ | grep -E '\.(js|cjs)$'
config/.eslintrc.strict.cjs
config/.prettierrc.cjs
config/jest.config.cjs
config/jest.config.js ← stale twin
config/lint-staged.config.cjs
config/lint-staged.config.js ← stale twin
| script references | repo actually contains |
|---|---|
eslint . --ext .ts,.js --config config/.eslintrc.strict.js |
config/.eslintrc.strict.cjs |
prettier --write --config config/.prettierrc.js |
config/.prettierrc.cjs |
prettier --check --config config/.prettierrc.js |
config/.prettierrc.cjs |
jest --config=config/jest.config.js (test:coverage, coverage:check) |
config/jest.config.cjs |
The .cjs files are not stubs — they are the maintained versions. config/jest.config.cjs differs from its .js twin by carrying the correct ts-jest path (<rootDir>/../agentic-flow/config/tsconfig.json vs the stale <rootDir>/tsconfig.json), so the migration also fixed a real bug that the scripts never picked up. Same for lint-staged.config.{js,cjs}, which also differ.
The rename was presumably done because the root package.json declares "type": "module", which makes a module.exports file with a .js extension unloadable. That reasoning is right; only package.json was left behind.
1. npm run lint
$ npm run lint
> eslint . --ext .ts,.js --config config/.eslintrc.strict.js
at loadJSConfigFile (node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2583:47)
at loadConfigFile (node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2667:20)
at ConfigArrayFactory._loadConfigData (…:2984:42)
exit 2
config/.eslintrc.strict.cjs exists and is tracked. There is also a ./.eslintrc.json at the repo root, which nothing references.
2. npm run format
$ npm run format
> prettier --write --config config/.prettierrc.js "**/*.{ts,js,json,md,yml,yaml}" --ignore-path config/.prettierignore
[error] Invalid configuration for file ".agentic-flow/intelligence.json":
[error] Cannot find module '<repo>/config/.prettierrc.js' imported from node_modules/prettier/index.mjs
exit 2
config/.prettierrc.cjs exists. format:check fails identically, which is what breaks quality:check.
Minor, separate: the glob picks up .agentic-flow/intelligence.json — a generated runtime artifact — because config/.prettierignore does not exclude it. Worth adding regardless of the config path.
3. npm run quality:check
"quality:check": "npm run lint && npm run format:check && npm run typecheck:strict && npm run test:coverage"
Fails at link 1 with the eslint error above. Because && short-circuits, none of format:check, typecheck:strict or test:coverage ever executes — and test:coverage is separately broken by the same root cause (#218). So the aggregate quality gate has never run any of its four stages.
4. npm run typecheck — works, and should stay as-is
$ npm run typecheck
> tsc --noEmit --project ./agentic-flow/config/tsconfig.json
agentic-flow/src/router/router.ts(411,31): error TS2339: Property 'predictedQuality' does not exist on type 'CostOptimalDecision'.
agentic-flow/src/services/embedding-service.ts(205,41): error TS2307: Cannot find module '@huggingface/transformers'.
agentic-flow/src/utils/model-cache.ts(216,41): error TS2307: Cannot find module '@huggingface/transformers'.
exit 2
This is correct behaviour — a real project reference, real errors, honest non-zero exit. The errors are the ones already reported in #213 (undeclared @huggingface/transformers, CostOptimalDecision missing four properties). Nothing to fix in the script itself.
Suggested fix
In package.json, point the six affected scripts at the .cjs files:
- "lint": "eslint . --ext .ts,.js --config config/.eslintrc.strict.js",
+ "lint": "eslint . --ext .ts,.js --config config/.eslintrc.strict.cjs",
- "format": "prettier --write --config config/.prettierrc.js …",
+ "format": "prettier --write --config config/.prettierrc.cjs …",
- "format:check": "prettier --check --config config/.prettierrc.js …",
+ "format:check": "prettier --check --config config/.prettierrc.cjs …",
- "test:coverage": "jest --coverage --config=config/jest.config.js",
+ "test:coverage": "jest --coverage --config=config/jest.config.cjs",
- "coverage:check": "jest --coverage --config=config/jest.config.js --coverageThreshold=…",
+ "coverage:check": "jest --coverage --config=config/jest.config.cjs --coverageThreshold=…",
Then delete config/jest.config.js and config/lint-staged.config.js. They already differ from their .cjs counterparts; leaving both means the next person edits whichever one they find first. (I hit exactly that — see my correction on #218.)
Related: #218 (test:coverage, same root cause), #213 (the typecheck errors above).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in package.json and compare the six scripts with config/.eslintrc.strict.cjs, config/.prettierrc.cjs, and config/jest.config.cjs; inspect the stale config/*.js twins before removing the named files. Run npm run lint, npm run format:check, and the relevant coverage commands to confirm they use the maintained configs, while preserving the existing typecheck errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- eslint, node.js, typescript
- Domain
- testing-qa, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100