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.

Windows line endings in config breaks CLI

See original GitHub issue

Expected Behavior

If you have windows line endings in your config file, things should run as normal

Current Behavior

If you run the recommended echo command on Windows, it will break things as it will output Windows Line Endings.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Add support for windows line endings in CLI

Steps to Reproduce (for bugs)

  1. Open Windows machine
  2. Run echo "module.exports = {extends: ['@commitlint/config-angular']};" > commitlint.config.js
  3. Run commitlint

Context

Trying to setup commitlint in my project on Windows

Your Environment

Executable Version
commitlint --version 5.6.0
git --version git version 2.16.0.windows.2
node --version v8.9.1

Issue Analytics

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

github_iconTop GitHub Comments

8reactions
ooliver1commented, Nov 21, 2021

for anyone still coming back after this long, i had the issue and i fixed it after 30m of head smashing

Get-Content commitlint.config.js | Set-Content -Encoding utf8 commitlint.config-utf8.js

for windows then delete original and rename new (so it doesnt say used by another process)

7reactions
wangrongdingcommented, Feb 11, 2022

On Windows, must through the notepad to open the file,Through the save as, change document character set!

1644603589(1)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring Git to handle line endings - GitHub Docs
autocrlf command is used to change how Git handles line endings. It takes a single argument. On Windows, you simply pass true to...
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 >
Introducing extended line endings support in Notepad
New files created within Notepad will use Windows line ending (CRLF) by default, but it will now be possible to view, edit, and...
Read more >
Preserve line endings - windows - Stack Overflow
If file contains both \n ( 0x0A ) and \r\n ( 0x0D 0x0A ) - this proposed solution (of always re-injecting the \r)...
Read more >
CRLF vs. LF: Normalizing Line Endings in Git
If one developer uses Windows and another uses Mac or Linux, and they each save and commit the same files, they may see...
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