chore: switch to @tony.ganchev/eslint-plugin-header#2395
chore: switch to @tony.ganchev/eslint-plugin-header#2395tonyganchev wants to merge 2 commits intoinstana:mainfrom
Conversation
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 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 Btw, the improved regex should work with the old plugin as well and should keep the copyright headers much more rigid. |
Reasons:
Note that while the plugin is trying to be a drop-in replacement for the original plugin, it is not bug-compatible.
/* eslint-disable ... */pragma is on the first line otherwise it won't apply to the violations reported by this plugin.IBM Corp. 20215because it didn't match til the end of the line. Instead of making the new regex to match this typo, I fixed the typo.