Skip to content

Fix enum strings used in error messages #1283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2025
Merged

Conversation

jakebailey
Copy link
Member

Noticed these while working on another PR. Yay reverse mapping. Good thing our error messages use uppercase form?

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates error messages to use uppercase enum strings and adjusts the stringer code generation for enum representations. Key changes include:

  • Revision of baseline error message diffs for various module targets (nodenext, node18, node16) to reflect the new enum names.
  • Removal of the combined compileroptions_stringer_generated.go file and introduction of separate generated files for ModuleKind and ScriptTarget.
  • Update of go:generate directives in internal/core/compileroptions.go to align with the new generation strategy.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
testdata/baselines/reference/submodule/conformance/nodeModulesJson(module=nodenext).errors.txt.diff Updated error messages to reference the new ModuleKindNodeNext enum string.
testdata/baselines/reference/submodule/conformance/nodeModulesJson(module=nodenext).errors.txt Revised error messages for NodeNext to new expected enum representations.
testdata/baselines/reference/submodule/conformance/nodeModulesJson(module=node18).errors.txt.diff Adjusted error messages to update references from Node18 to ModuleKindNode18 where applicable.
testdata/baselines/reference/submodule/conformance/nodeModulesJson(module=node18).errors.txt Revised error baseline for Node18 with corrected enum strings.
testdata/baselines/reference/submodule/conformance/nodeModulesJson(module=node16).errors.txt.diff Modified error messages to use Node16 instead of ModuleKindNode16.
testdata/baselines/reference/submodule/conformance/nodeModulesJson(module=node16).errors.txt Revised Node16 error messages to reflect the new enum naming.
internal/core/scripttarget_stringer_generated.go New generated file for ScriptTarget enum string conversion.
internal/core/modulekind_stringer_generated.go New generated file for ModuleKind enum string conversion.
internal/core/compileroptions_stringer_generated.go Removed outdated generated file in favor of separate ones.
internal/core/compileroptions.go Updated go:generate directives to generate separate stringer files with the proper trimprefix settings.

@jakebailey jakebailey added this pull request to the merge queue Jun 25, 2025
Merged via the queue into main with commit 8370e5f Jun 25, 2025
22 checks passed
@jakebailey jakebailey deleted the jabaile/fix-stringer branch June 25, 2025 23:32
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.

2 participants