Skip to content
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

Allow comments in .angular-cli.json #5610

Closed
mxii opened this issue Mar 24, 2017 · 13 comments
Closed

Allow comments in .angular-cli.json #5610

mxii opened this issue Mar 24, 2017 · 13 comments
Labels
effort1: easy (hours) feature Issue that requests a new feature P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@mxii
Copy link
Contributor

mxii commented Mar 24, 2017

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ x ] feature request

Versions.

v1.0.0

Repro steps.

ng s

The log given by the failure.

InvalidConfigError: Parsing .angular-cli.json failed. Please make sure your .angular-cli.json is valid JSON. Error:
SyntaxError: Unexpected token / in JSON at position 533

Desired functionality.

Would be really great to be able to put comments to that file. :)

@mxii mxii changed the title Allo comments in .angular-cli.json Allow comments in .angular-cli.json Mar 24, 2017
@aslan92
Copy link

aslan92 commented Mar 24, 2017

JSON file can not contain comments!

@trevor-hackett
Copy link

JSON format doesn't allow comments. This is not a limitation with the CLI. It's a limitation of JSON itself.

@filipesilva
Copy link
Contributor

Closing as the community already answered this, thanks guys!

@filipesilva
Copy link
Contributor

Actually, let's keep this open... I misread it as a bug report, but it's a very reasonable feature request.

@filipesilva filipesilva reopened this Mar 24, 2017
@filipesilva filipesilva added P5 The team acknowledges the request but does not plan to address it, it remains open for discussion type: discussion feature Issue that requests a new feature labels Mar 24, 2017
@bekos
Copy link

bekos commented Aug 28, 2017

Sorry if you have answered it elsewhere, but can this file actually be a .js file instead of .json?
It will be much more flexible and easier to work with.

@filipesilva
Copy link
Contributor

@bekos no, that is not supported.

@bekos
Copy link

bekos commented Aug 31, 2017

@filipesilva This would help if we actually needed a bit different setup for production and development setups in angular-cli. Does this make sense for a new feature request?

@filipesilva
Copy link
Contributor

@bekos I'm curious on the particulars of your scenario. Can you open a new issue to discuss your request?

@manuel-di-iorio
Copy link

Would be nice to use https://www.npmjs.com/package/strip-json-comments

const json = '{/*rainbows*/"unicorn":"cake"}';
 
JSON.parse(stripJsonComments(json));
//=> {unicorn: 'cake'} 

@listepo
Copy link

listepo commented Dec 26, 2017

I think strip-json-comments this is a very good solution. @filipesilva what do you think?

@aristotll
Copy link

aristotll commented Feb 9, 2018

I think this is a great feature and the tsconfig.json also allows comments, microsoft/TypeScript#4987.

The config files need comments for clarification and future reading.

@alan-agius4
Copy link
Collaborator

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort1: easy (hours) feature Issue that requests a new feature P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.