Cleanup source code from bundling artifacts #12
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR removes all webpack/ncc bundling artifacts from the ESLint formatters and restores them to standard Node.js modules with clean, maintainable source code.
Problem
All formatter packages were previously bundled with webpack/ncc, which added significant boilerplate code and made the source difficult to read and maintain. Each formatter file contained:
__webpack_modules__object wrapper__nccwpck_require__function instead of standardrequire()For example, a simple formatter like
eslint-formatter-jsonthat should be ~10 lines was expanded to 66 lines due to bundling overhead.Solution
1. Removed Bundling Artifacts
__webpack_modules__wrapper objects__nccwpck_require__with standard Node.jsrequire()calls2. Extracted Shared Modules
Created
xml-escape.jshelper modules in packages that share this functionality:eslint-formatter-checkstyle/xml-escape.jseslint-formatter-jslint-xml/xml-escape.jseslint-formatter-junit/xml-escape.jsThis follows the principle of extracting bundled modules into separate files as specified in the requirements.
3. Converted to Standard Node.js
All formatters now use standard
require()calls:Impact
Files Changed
Modified (10 files):
packages/eslint-formatter-checkstyle/index.jspackages/eslint-formatter-compact/index.jspackages/eslint-formatter-jslint-xml/index.jspackages/eslint-formatter-json/index.jspackages/eslint-formatter-json-with-metadata/index.jspackages/eslint-formatter-junit/index.jspackages/eslint-formatter-stylish/index.jspackages/eslint-formatter-tap/index.jspackages/eslint-formatter-unix/index.jspackages/eslint-formatter-visualstudio/index.jsCreated (3 files):
packages/eslint-formatter-checkstyle/xml-escape.jspackages/eslint-formatter-jslint-xml/xml-escape.jspackages/eslint-formatter-junit/xml-escape.jsTesting
✅ All 40 existing tests pass
✅ No security vulnerabilities detected (CodeQL)
✅ Dependencies properly declared in package.json files
✅ Code formatted with Prettier
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
💡 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.