Skip to content

Html file without indentation #14816

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

Closed
SamanthaAdrichem opened this issue Jun 18, 2019 · 2 comments · Fixed by #14817
Closed

Html file without indentation #14816

SamanthaAdrichem opened this issue Jun 18, 2019 · 2 comments · Fixed by #14817

Comments

@SamanthaAdrichem
Copy link
Contributor

🚀 Feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Description

A clear and concise description of the problem or missing capability...

The HTML files for angular-cli are now also generated using an indentation of two spaces.
tslint can be used to fix this for the typescript files to your own style.

the HTML template is however excluded from this.

Most editors, like PHPStorm have the feature: "On edit, use indents of the openend file" so removing it and correcting it won't fix it unless you close the file so that it no longer knows it was indented incorrectly. Or press the 'convert' button.

Since the template only contains dummy test content within a

tag, i'd suggest to remove the whitespace and indentation, which will resolve this issue for most users, for the file then does not have an active indentation. And the contents will be cleared completely afterwords anyways.

Maybe my flow of toughts is incorrect. But I do really think this will fix some issues for a lot of people.

Describe the solution you'd like

If you have a solution in mind, please describe it.

Update the templates (as in pull request) to not use any indentation

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?

I can disable the as-is feature of the editor, but that is not wanted.
I can overwrite the component schematic to replace the HTML contents afterwords, but still.

@SamanthaAdrichem
Copy link
Contributor Author

Somehow it doesn't link it here correctly but there is a PR for this request
#14817

mgechev pushed a commit that referenced this issue Jun 19, 2019
Most editors remember the indentation, even if you remove all code. This way, there is no
indentation thus there is nothing for the editor to remember and there will be no need for
a HTML lint fix.

Fixes #14816
mgechev pushed a commit that referenced this issue Jun 19, 2019
Most editors remember the indentation, even if you remove all code. This way, there is no
indentation thus there is nothing for the editor to remember and there will be no need for
a HTML lint fix.

Fixes #14816
@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant