eslint-plugin-header icon indicating copy to clipboard operation
eslint-plugin-header copied to clipboard

Prevent it from eating existing header comments

Open amacneil opened this issue 4 years ago • 1 comments

Let's say I have a file with an existing comment:

// log 1
console.log(1);

Is there a way I can prevent eslint-plugin-header from removing the existing comment, and prepend the header template instead?

amacneil avatar Feb 25 '21 08:02 amacneil

I would say this should have been the default - if the leading comment does not match the expected header, then no header is present and the auto-fix prepends the header before the first comment.

We can further add error reporting to explain that the first header did not match the expected header.

I've forked the plugin for a year and I'll track the proposed improvement under https://github.com/tonyganchev/eslint-plugin-header/issues/63

tonyganchev avatar Oct 31 '25 06:10 tonyganchev