Skip to content

chore: switch to @tony.ganchev/eslint-plugin-header#2395

Open
tonyganchev wants to merge 2 commits intoinstana:mainfrom
tonyganchev:main
Open

chore: switch to @tony.ganchev/eslint-plugin-header#2395
tonyganchev wants to merge 2 commits intoinstana:mainfrom
tonyganchev:main

Conversation

@tonyganchev
Copy link

Reasons:

  • The fork is supported and updated.
  • ESLint 9-native with full schema support and needing no hacks.
  • Windows support
  • Multiple other bugfixes.
  • UX improvements - better error messages and more autofix capabilities.
  • Extensive documentation.
  • Better configuration format (although the old one is still supported).

Note that while the plugin is trying to be a drop-in replacement for the original plugin, it is not bug-compatible.

  • fix to properly report problematic lines requires that /* eslint-disable ... */ pragma is on the first line otherwise it won't apply to the violations reported by this plugin.
  • some patterns used worked in the previous plugin to match some atypical headers in the current code-base. Had to fix two header and switch the patterns to be a single regex. In particular \d[4} matched IBM Corp. 20215 because it didn't match til the end of the line. Instead of making the new regex to match this typo, I fixed the typo.

Reasons:
- The fork is supported and updated.
- ESLint 9-native with full schema support and needing no hacks.
- Windows support
- Multiple other bugfixes.
- UX improvements - better error messages and more autofix capabilities.
- Extensive documentation.
- Better configuration format (although the old one is still supported).

Note that while the plugin is trying to be a drop-in replacement for the original plugin, it is **not bug-compatible**.
- fix to properly report problematic lines requires that `/* eslint-disable ... */` pragma is on the first line otherwise it won't apply to the violations reported by this plugin.
- some patterns used worked in the previous plugin to match some atypical headers in the current code-base. Had to fix two header and switch the patterns to be a single regex. In particular \d[4} matched `IBM Corp. 20215` because it didn't match til the end of the line. Instead of making the new regex to match this typo, I fixed the typo.
@tonyganchev tonyganchev requested a review from a team as a code owner March 7, 2026 10:55
@aryamohanan
Copy link
Contributor

@tonyganchev Thanks for the PR and for sharing the improvements in your fork.

We haven’t experienced any issues with the current plugin so far, so there isn’t an immediate need for us to change dependencies. That said, we’ll take some time to review this with the team. We also appreciate the effort you’ve put into maintaining and improving the fork.

@tonyganchev
Copy link
Author

@tonyganchev Thanks for the PR and for sharing the improvements in your fork.

We haven’t experienced any issues with the current plugin so far, so there isn’t an immediate need for us to change dependencies. That said, we’ll take some time to review this with the team. We also appreciate the effort you’ve put into maintaining and improving the fork.

Sure, for a stable project where new files simply copy-paste existing headers you can stay with the current one. The potential benefit I see you can reap in your case is that you can move to ESLint 9 without ugly workarounds (turning off schema validation for the plugin). In the future I am looking into supporting optional header lines which should make the regex easier to follow.

Another issue plaguing existing projects is that eslint-plugin-header does some strange autofixes in cases where the file has leading non-header comments. You have not experienced this as you don't add template properties to the pattern object which should be fairly easy given your copyright format.

Btw, the improved regex should work with the old plugin as well and should keep the copyright headers much more rigid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants