Skip to content

Adding Comments in JSON file format #34066

Closed as not planned
Closed as not planned

Description

@RishiSharma62004

Command

config

Description

Currently, Angular CLI configuration files that use the JSON format do not support comments. This makes it difficult for developers to document configuration values, explain the purpose of specific settings, or provide additional context directly within the configuration file.
Configuration files often contain values such as URLs, environment-specific settings, build options, asset paths, proxy configurations, or other properties whose purpose may not be immediately obvious to other developers working on the project.

Describe the solution you'd like

Consider supporting comments in Angular CLI JSON configuration files, either by:

Supporting a JSON-based format that allows comments, such as JSONC.
Supporting a compatible configuration syntax that permits // and/or /* */ comments.
Or providing another officially supported mechanism for documenting configuration values directly within the configuration file.
For example:

{
"projects": {
"my-app": {
"architect": {
"build": {
"options": {
// Required when the application is deployed under a sub-path.
"baseHref": "/my-application/"
}
}
}
}
}
}

Expected Benefits
Supporting comments would make Angular CLI configuration files:

Easier to understand for new and existing developers.
More self-documenting.
Easier to maintain and review.
Better suited for documenting non-obvious configuration decisions.
Less dependent on external documentation for configuration-specific context.
Backward Compatibility
Existing valid JSON configuration files should continue to work without modification. Comment support should be an additive enhancement and should not change the behavior of existing configuration properties.

Additional Context
This feature would be particularly useful for large projects and teams where configuration values may have historical, environment-specific, or deployment-related reasons that are not obvious from the value itself.

Describe alternatives you've considered

No response

Activity

  1. added
    gemini-triaged
    on Sep 10, 2026
  2. added this to the needsTriage milestone on Sep 10, 2026
  3. alan-agius4 commented on Sep 10, 2026

    @alan-agius4
    Collaborator

    Comments are already supported in angular.json.

  4. angular-automatic-lock-bot commented on Oct 21, 2026

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  5. locked and limited conversation to collaborators on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @angular/cligemini-triaged

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions