Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 23, 2025

Problem

The eslint-formatter-checkstyle package (v9.0.0) was failing when used with ESLint due to a missing xml-escape module:

Error: Cannot find module './xml-escape'
Require stack:
- /app/node_modules/eslint-formatter-checkstyle/index.js

This issue also affected eslint-formatter-jslint-xml and eslint-formatter-junit, which also depend on the xml-escape.js file.

Root Cause

The files array in each package's package.json explicitly listed only index.js and index.d.ts, which excluded the xml-escape.js file required by the XML-based formatters. This was introduced in PR #12.

Solution

  • Removed the files array from all 10 package.json files in packages/*
  • Bumped version from 9.0.0 to 9.0.1 for all packages

By removing the files array, npm will now automatically include all necessary files when publishing the packages (based on .npmignore or default behavior), ensuring that xml-escape.js and any other required files are included.

Verification

All three XML-based formatters now load and execute successfully:

  • eslint-formatter-checkstyle - loads xml-escape and formats output correctly
  • eslint-formatter-jslint-xml - loads xml-escape and formats output correctly
  • eslint-formatter-junit - loads xml-escape and formats output correctly

Other formatters (compact, json, unix, etc.) continue to work as expected.

Fixes #13

Original prompt

This section details on the original issue you should resolve

<issue_title>Missing xml-escape file</issue_title>
<issue_description>Package: eslint-formatter-checkstyle
Version: 9.0.0
Node version: v22.18.0
ESLint version: v9.37.0

Description

When running ESLint with the checkstyle formatter, the formatter crashes due to a missing file (xml-escape).

Command

node_modules/.bin/eslint -f checkstyle -o build-logs/eslint.xml .

Output

/app/node_modules/eslint-formatter-checkstyle/index.js Error: Cannot find module './xml-escape'
Require stack:
- /app/node_modules/eslint-formatter-checkstyle/index.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1365:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1021:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1026:22)
    at Function._load (node:internal/modules/cjs/loader:1175:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.require (node:internal/modules/cjs/loader:1445:12)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (/app/node_modules/eslint-formatter-checkstyle/index.js:6:19)
    at Module._compile (node:internal/modules/cjs/loader:1688:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/app/node_modules/eslint-formatter-checkstyle/index.js' ]
}

Root cause

PR: #12</issue_description>

Comments on the Issue (you are @copilot in this section)

@fregante @copilot this is because the `packages/*/package.json` files have a files array. Remove it. Also bump them all to v9.0.1

Fixes #17


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing xml-escape file in eslint-formatter-checkstyle Fix missing xml-escape file and bump version to 9.0.1 Oct 23, 2025
Copilot AI requested a review from fregante October 23, 2025 11:53
@fregante fregante changed the title Fix missing xml-escape file and bump version to 9.0.1 Fix missing xml-escape file Oct 23, 2025
@fregante fregante marked this pull request as ready for review October 23, 2025 12:08
@fregante fregante merged commit d55fede into main Oct 23, 2025
9 checks passed
@fregante fregante deleted the copilot/fix-missing-xml-escape-file branch October 23, 2025 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update eslint-formatter-html mentions Missing xml-escape file

2 participants