From 6fdb0b81b393d209504ddbbac0cd4b3d90be670b Mon Sep 17 00:00:00 2001 From: Tony Ganchev Date: Sun, 15 Mar 2026 19:32:02 +0200 Subject: [PATCH] chore: switch to @tony.ganchev/eslint-plugin-header Hi, team, I noticed you are using eslint-plugin-header on ESLint 8. I forked @tony.ganchev/eslint-plugin-header mid-2024 to add support for ESLint 9 and hoped it would be a temporary measure but since the original has not been updated for five years I decided to continue improving the new plugin and have been doing so for the last two years. Specific improvements include: - full JSON schema for validating the configuration. - fixed multiple bugs with the behavior of the plugin on Windows. - many other bug-fixes. - improved autofixing and error-reporting behavior. - added support for leading pragma comments before the header such as @jest-environment. I've sent PR proposals to other projects in the cloudscape-design space: - https://github.com/cloudscape-design/components/pull/4308 Looking forward to your feedback. --- .eslintrc | 6 +++--- package-lock.json | 21 +++++++++++---------- package.json | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.eslintrc b/.eslintrc index 340e9359..d84f9cab 100644 --- a/.eslintrc +++ b/.eslintrc @@ -13,7 +13,7 @@ "jsx": true } }, - "plugins": ["react-hooks", "react", "header", "@eslint-react/eslint-plugin", "eslint-plugin-simple-import-sort", "eslint-plugin-unused-imports"], + "plugins": ["react-hooks", "react", "@tony.ganchev/header", "@eslint-react/eslint-plugin", "eslint-plugin-simple-import-sort", "eslint-plugin-unused-imports"], "rules": { "@typescript-eslint/interface-name-prefix": "off", "@typescript-eslint/no-explicit-any": "off", @@ -26,7 +26,7 @@ "eqeqeq": "error", "no-return-await": "error", "require-await": "error", - "header/header": [ + "@tony.ganchev/header/header": [ "error", "line", [" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.", " SPDX-License-Identifier: MIT-0"] @@ -54,7 +54,7 @@ { "files": ["*.json"], "rules": { - "header/header": "off" + "@tony.ganchev/header/header": "off" } }, { diff --git a/package-lock.json b/package-lock.json index b25b38f5..3c53f775 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "@cloudscape-design/theming-runtime": "^1.0.0", "@eslint-react/eslint-plugin": "^1.16.1", "@svgr/webpack": "^8.1.0", + "@tony.ganchev/eslint-plugin-header": "^3.3.1", "@types/jest": "^29.5.14", "@types/lodash": "^4.14.184", "@types/node": "^20.16.8", @@ -43,7 +44,6 @@ "date-fns": "^4.1.0", "eslint": "^8.22.0", "eslint-config-prettier": "^10.0.2", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-prettier": "^5.2.3", "eslint-plugin-react": "^7.30.1", "eslint-plugin-react-hooks": "^4.6.0", @@ -5413,6 +5413,16 @@ "url": "https://github.com/sponsors/gregberge" } }, + "node_modules/@tony.ganchev/eslint-plugin-header": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@tony.ganchev/eslint-plugin-header/-/eslint-plugin-header-3.3.1.tgz", + "integrity": "sha512-/Fj0+DaXbBfrlXmd3wBZkB8TIwGT3N++y/oTYxRABK/gzNxjgcBjt63xBpuHCYIXmH1EwuALd6XS1fzNG4S0zg==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": ">=7.7.0" + } + }, "node_modules/@tootallnate/quickjs-emscripten": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", @@ -10179,15 +10189,6 @@ "eslint": ">=7.0.0" } }, - "node_modules/eslint-plugin-header": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz", - "integrity": "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==", - "dev": true, - "peerDependencies": { - "eslint": ">=7.7.0" - } - }, "node_modules/eslint-plugin-prettier": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.3.tgz", diff --git a/package.json b/package.json index fb667887..952cead4 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "@cloudscape-design/theming-runtime": "^1.0.0", "@eslint-react/eslint-plugin": "^1.16.1", "@svgr/webpack": "^8.1.0", + "@tony.ganchev/eslint-plugin-header": "^3.3.1", "@types/jest": "^29.5.14", "@types/lodash": "^4.14.184", "@types/node": "^20.16.8", @@ -57,7 +58,6 @@ "date-fns": "^4.1.0", "eslint": "^8.22.0", "eslint-config-prettier": "^10.0.2", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-prettier": "^5.2.3", "eslint-plugin-react": "^7.30.1", "eslint-plugin-react-hooks": "^4.6.0",