eslint-doc-generator icon indicating copy to clipboard operation
eslint-doc-generator copied to clipboard

Duplicated auto-generated rules header on Windows

Open MikeMcC399 opened this issue 1 year ago • 2 comments

Issue

eslint-doc-generator duplicates auto-generated rules headers leading to duplicate visible sections such as the following:

💼 This rule is enabled in the ✅ `recommended` config.

<!-- end auto-generated rule header -->

💼 This rule is enabled in the ✅ `recommended` config.

<!-- end auto-generated rule header -->

This problem seems to affect Windows only. I could not reproduce it on Ubuntu 22.04.4 LTS for example.

Versions

Operating System: Windows 11 Node.js: 20.12.2 LTS eslint: 8.57.0 eslint-doc-generator: 1.7.0

Steps to reproduce

On Windows 11 with Node.js 20.12.2 LTS

git clone --branch show/doc-generation https://github.com/MikeMcC399/eslint-plugin-cypress --single-branch
cd eslint-plugin-cypress
npm ci
npx eslint-doc-generator

View the top of the file docs/rules/no-assigning-return-values.md.

For example, using the Git Bash shell:

head docs/rules/no-assigning-return-values.md

and note that the auto-generated rule header appears twice.

MikeMcC399 avatar Apr 27 '24 14:04 MikeMcC399

Thanks for the detailed report. I haven't been able to test on Windows yet but I suspect I have a fix in #524.

bmish avatar Apr 28 '24 15:04 bmish

@bmish

  • Thanks for picking this up in #524! I missed that it had already been reported in #510 as that issue was closed and I only recognized it as a duplicate after watching the video.

MikeMcC399 avatar Apr 28 '24 16:04 MikeMcC399

Let me know if https://github.com/bmish/eslint-doc-generator/releases/tag/v1.7.1 fixes this.

bmish avatar May 08 '24 16:05 bmish

@bmish

Thank you very much for fixing this issue! I ran it on the production version of eslint-plugin-cypress and it's working perfectly now:

git clone https://github.com/cypress-io/eslint-plugin-cypress
cd eslint-plugin-cypress
npm ci
npm install [email protected] -D
npx eslint-doc-generator

No duplication of headers anymore!

MikeMcC399 avatar May 08 '24 17:05 MikeMcC399