Skip to content

Inserted tables have mixed LF/CRLF line endings #726

@MikeMcC399

Description

@MikeMcC399

Current behavior

On Windows:

If eslint-doc-generator is run on top of existing documents stored with CRLF line ending, it refreshes tables and replaces some lines with LF line endings. This leaves the corresponding files with mixed line endings.

Expected behavior

If eslint-doc-generator is updating an existing document it should use the same line endings that the original document was using. Running the doc generator should not result in a document containing mixed line endings.

Steps to reproduce

Windows 11 24H2, Node.js 22.16.0 LTS
eslint-doc-generator@2.1.2

git clone --branch test/windows https://github.com/MikeMcC399/eslint-plugin-cypress
cd eslint-plugin-cypress
npm ci
npx eslint-doc-generator
git diff

Open the following documents in notepad++ with View > Show Symbol > Show End of Line

  • README.md
  • docs/rules/unsafe-to-chain-command.md

README.md

Image

docs/rules/unsafe-to-chain-command.md

Image

Logs

$ git diff
warning: in the working copy of 'README.md', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'docs/rules/unsafe-to-chain-command.md', LF will be replaced by CRLF the next time Git touches it

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions