question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for Windows line endings

See original GitHub issue

Bug Report or Feature Request (mark with an x)

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

Versions.

$ ng --version
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.0.6
node: 6.10.2
os: win32 x64
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.6
@angular/compiler-cli: 4.1.3

Running on Windows 10.

Repro steps.

$ ng new demo
$ cd demo
$ ng generate component DemoComponent
$ git add .
warning: LF will be replaced by CRLF in src/app/app.module.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/demo-component/demo-component.component.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/demo-component/demo-component.component.spec.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/demo-component/demo-component.component.ts.
The file will have its original line endings in your working directory.

The log given by the failure.

None.

Desired functionality.

I’d like a setting to make ng generate create files with Windows line endings (CRLF) instead of the currently used Unix line endings (LF). This would increase users flexibility on Windows environments, where it’s still common to use Windows line endings as a default.

The setting could look like ng set --global end_of_line=crlf.

Mention any other details that might be useful.

None.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
clydincommented, May 28, 2017

You can use this tslint rule (https://palantir.github.io/tslint/rules/linebreak-style/) and use ng lint --fix. In the upcoming version 1.1, you’ll be able to use the new --lint-fix option on the generate command or add it as a default in .angular-cli.json.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 8, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introducing extended line endings support in Notepad
Starting with the current Windows 10 Insider build, Notepad will support Unix/Linux line endings (LF), Macintosh line endings (CR), and Windows ...
Read more >
Configuring Git to handle line endings - GitHub Docs
You can configure Git to handle line endings automatically so you can collaborate effectively with people who use different operating systems. Global settings ......
Read more >
Converting from Windows-style to UNIX-style line endings
All versions of Microsoft Windows represent line endings as CR followed by LF. ... go to the Edit menu, select the "EOL Conversion"...
Read more >
DOS vs. Unix Line Endings
Text files created on DOS/Windows machines have different line endings than files created on Unix/Linux. DOS uses carriage return and line feed ("\r\n")...
Read more >
Fixing misaligned Linux and Windows line endings
Windows and Linux line endings don't match, which causes trouble if you're moving files from a Windows desktop to a Linux container.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found