Summary
The prefer-core-logging suggestion fix rebuilds the call as core.method(<all original args joined by ", ">). But @actions/core logging methods take a single message: string argument — trailing arguments are silently ignored at runtime, and printf-style format specifiers (%s, %d, %o) that console.* interpolates are not interpolated by core.*. The autofix therefore drops data.
Grounded evidence
mcp_http_transport.cjs:295: console.error("MCP HTTP Transport error:", error) -> autofix core.error("MCP HTTP Transport error:", error). error is passed as a second argument to core.error(message) and is dropped — the actual error object is lost from the log.
- The rule's own test canonizes the lossy behavior:
src/rules/prefer-core-logging.test.ts:180 expects console.log("value:", someVar) -> core.info("value:", someVar), where someVar no longer reaches the output.
Acceptance criteria
- Withhold the suggestion (report-only / no fix) when
node.arguments.length !== 1, since a mechanical single-message rewrite cannot preserve multi-argument semantics.
- Also withhold (or specially handle) when the sole/first string argument contains a
%-format specifier.
- If a fix is still desired for the multi-arg case, join arguments into a single interpolated string (e.g. a template literal) rather than passing them positionally; the safe default is report-only.
- Update
prefer-core-logging.test.ts:175-191 to assert no autofix (or a correctly-joined single-arg fix) for the multi-arg case.
- Re-verify
mcp_http_transport.cjs:295 no longer receives a data-dropping autofix.
Generated by 🤖 ESLint Refiner · 312.3 AIC · ⌖ 12.9 AIC · ⊞ 4.6K · ◷
Summary
The
prefer-core-loggingsuggestion fix rebuilds the call ascore.method(<all original args joined by ", ">). But@actions/corelogging methods take a singlemessage: stringargument — trailing arguments are silently ignored at runtime, and printf-style format specifiers (%s,%d,%o) thatconsole.*interpolates are not interpolated bycore.*. The autofix therefore drops data.Grounded evidence
mcp_http_transport.cjs:295:console.error("MCP HTTP Transport error:", error)-> autofixcore.error("MCP HTTP Transport error:", error).erroris passed as a second argument tocore.error(message)and is dropped — the actual error object is lost from the log.src/rules/prefer-core-logging.test.ts:180expectsconsole.log("value:", someVar)->core.info("value:", someVar), wheresomeVarno longer reaches the output.Acceptance criteria
node.arguments.length !== 1, since a mechanical single-message rewrite cannot preserve multi-argument semantics.%-format specifier.prefer-core-logging.test.ts:175-191to assert no autofix (or a correctly-joined single-arg fix) for the multi-arg case.mcp_http_transport.cjs:295no longer receives a data-dropping autofix.