Skip to content

eslint-factory: add a test suite for require-parseInt-radix (currently zero coverage) #42015

Description

@github-actions

Summary

The require-parseInt-radix rule (eslint-factory/src/rules/require-parseInt-radix.ts) ships with no test file. Its sibling require-json-parse-try-catch has a comprehensive suite (require-json-parse-try-catch.test.ts, 6 cases covering valid / invalid / suggestion / computed-access), but require-parseInt-radix has none. This leaves the rule regression-prone: a refactor (e.g. the kind in #42000) could silently break detection or introduce false positives with nothing to catch it.

The rule is live (eslint.config.cjs enables it as warn) and currently flags real defects — e.g. missing-radix sites in actions/setup/js/parse_codex_log.cjs (lines 32, 145, 146, 798, 806).

Acceptance criteria

  • New file eslint-factory/src/rules/require-parseInt-radix.test.ts using RuleTester + vitest, mirroring the style of require-json-parse-try-catch.test.ts.
  • Valid cases: parseInt(str, 10), parseInt(str, 16), Number.parseInt(str, 10), and non-parseInt calls (foo.parseInt(x), parseFloat(x)).
  • Invalid cases (report requireRadix): parseInt(str), parseInt(str.trim()), Number.parseInt(str).
  • Cover both CommonJS and ES module sourceType (the config lints .cjs as commonjs, tests as module).
  • npm test (vitest) passes in eslint-factory.

Scope

eslint-factory/** only. No change to rule logic in this task.

Filed by ESLint Refiner (daily run 2026-06-28).

Generated by 🤖 ESLint Refiner · 178.3 AIC · ⌖ 11.7 AIC · ⊞ 4.7K ·

  • expires on Jul 4, 2026, 10:44 PM UTC-08:00

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions