Add local CodeFactor parity lint tooling
Merged
UN
4mo ago+1226+1226+0123456789012345678901234567890123456789-18-18-01234567890123456789
Summary
- Adds
pnpm lintas a local CodeFactor parity gate: ESLint maintainability rules, jscpd duplicate reporting, and the existing static quality profile. - Wires
pnpm lintinto the CI static gate and locks the new dev tooling. - Documents the lint workflow and release gate mapping, regenerates
CHANGELOG.mdwithpm-changelog, and closes the CodeFactor parity/complexity/duplication PM items.
Verification
pm test pm-6sqo --run --progresspnpm lintnode scripts/run-tests.mjs test -- tests/integration/ci-workflow-contract.spec.ts tests/integration/release-automation-contract.spec.ts tests/integration/release-readiness-runtime.spec.tspnpm typecheckpnpm quality:staticpnpm contracts:checkpnpm security:scanpnpm audit --audit-level moderatepnpm changelog:pm:checknode scripts/run-tests.mjs coverage-> 256 files, 5133 tests, 100/100/100/100npm pack --dry-run --silentnode dist/cli.js package doctor --project --detail deep --jsonpm health --check-only --summary --jsonnode scripts/release/sentry-telemetry-gate.mjs --json --telemetry-mode best-effort- Manual isolated temp smoke in
/tmp/tmp.ExXdcpRd86with todos package doctor - Strict warning-free isolated temp smoke in
/tmp/tmp.vRdXivNLZSwith itemtemp-codefactor-lint-zbd9
Notes
- jscpd currently reports the known 30-clone / 0.34% baseline and fails above the configured 0.35 threshold, so current main passes while new duplication regresses locally and in CI.
- GitHub issue #374 remains an external
RELEASE_PATenvironment blocker; no code-side fix is pending in this branch.
Summary by Sourcery
Introduce a unified local lint command that mirrors CodeFactor maintainability, complexity, and duplication gates and wire it into the documented and automated release workflow.
New Features:
- Add a top-level pnpm lint script that runs ESLint maintainability rules, duplication checks, and the existing static quality gate in a single command.
Enhancements:
- Configure ESLint (including unicorn and TypeScript support) and jscpd to align local linting with CodeFactor’s maintainability and duplication signals.
- Extend testing and release-readiness contracts to validate the presence and shape of the new lint script in package.json.
- Record CodeFactor-driven complexity and duplication remediation, and the new parity tooling, in the changelog and internal PM artifacts.
Build:
- Add eslint, eslint-plugin-unicorn, typescript-eslint, jscpd, and shared ESLint/jscpd config to the development toolchain.
CI:
- Integrate pnpm lint into the main CI static gate so CodeFactor-aligned linting runs on every pipeline.
Documentation:
- Document the lint workflow in TESTING and RELEASING guides, clarifying how the new lint command maps to CodeFactor parity and existing static quality gates.
Tests:
- Update CI and release automation integration tests to assert that the new lint command is present and enforced in the workflow.
Chores:
- Track and close CodeFactor parity, complexity, and duplication chores via updated PM task and history files.
Summary by cubic
Adds a local CodeFactor-parity lint gate with pnpm lint and fixes a Windows atomic write flake by retrying transient rename errors. Aligns jscpd/ESLint generated-directory ignores and updates release docs to reflect the actual static quality gate.
-
New Features
- Adds
pnpm lintcomposed oflint:eslint,lint:duplicates(jscpd), andlint:codefactor(delegates toquality:static). - Adds
eslint.config.mjswith CodeFactor-like rules and.jscpd.json(threshold0.35); mirrors ESLint generated-directory ignores in jscpd. - Updates CI to run
pnpm lint(replacesquality:staticstep); updates docs and tests for the new workflow and clarifies the release static gate scope.
- Adds
-
Bug Fixes
- Retries transient
EPERM/EBUSYon Windows duringfs.renameinwriteFileAtomicwith bounded backoff; adds unit tests. Addresses the Windows regression tracked in pm-2kkl.
- Retries transient