From b39854f59b33042af603a66daf0bde638c31ee07 Mon Sep 17 00:00:00 2001 From: Tony Ganchev Date: Mon, 16 Mar 2026 13:04:07 +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/board-components/pull/401 - https://github.com/cloudscape-design/browser-test-tools/pull/188 - https://github.com/cloudscape-design/chart-components/pull/185 - https://github.com/cloudscape-design/code-view/pull/122 - https://github.com/cloudscape-design/collection-hooks/pull/136 - https://github.com/cloudscape-design/component-toolkit/pull/200 - https://github.com/cloudscape-design/components/pull/4308 - https://github.com/cloudscape-design/demos/pull/243 - https://github.com/cloudscape-design/documenter/pull/112 - https://github.com/cloudscape-design/global-styles/pull/73 - https://github.com/cloudscape-design/jest-preset/pull/58 - https://github.com/cloudscape-design/test-utils/pull/114 - https://github.com/cloudscape-design/theming-core/pull/148 Looking forward to your feedback. --- .eslintrc | 4 ++-- package-lock.json | 22 +++++++++++----------- package.json | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.eslintrc b/.eslintrc index 0ce3bb8..2f8ec01 100644 --- a/.eslintrc +++ b/.eslintrc @@ -9,9 +9,9 @@ "jsx": true } }, - "plugins": ["unicorn", "header", "@typescript-eslint"], + "plugins": ["unicorn", "@tony.ganchev/header", "@typescript-eslint"], "rules": { - "header/header": [ + "@tony.ganchev/header/header": [ "error", "line", [" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.", " SPDX-License-Identifier: Apache-2.0"], diff --git a/package-lock.json b/package-lock.json index 73e3cf6..555ea40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "prepare-package-lock": "lib/scripts/prepare-package-lock.js" }, "devDependencies": { + "@tony.ganchev/eslint-plugin-header": "^3.3.1", "@types/lodash": "^4.17.21", "@types/node": "^20.19.24", "@types/react": "^16.14.0", @@ -24,7 +25,6 @@ "@vitest/coverage-v8": "^4.0.6", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.29.1", "eslint-plugin-no-unsanitized": "^4.0.2", "eslint-plugin-prettier": "^5.2.1", @@ -1319,6 +1319,16 @@ "dev": true, "license": "MIT" }, + "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/@types/chai": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", @@ -3150,16 +3160,6 @@ "ms": "^2.1.1" } }, - "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, - "license": "MIT", - "peerDependencies": { - "eslint": ">=7.7.0" - } - }, "node_modules/eslint-plugin-import": { "version": "2.32.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", diff --git a/package.json b/package.json index 1ed40b4..04f6de9 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "stylelint": "^16.8.1" }, "devDependencies": { + "@tony.ganchev/eslint-plugin-header": "^3.3.1", "@types/lodash": "^4.17.21", "@types/node": "^20.19.24", "@types/react": "^16.14.0", @@ -41,7 +42,6 @@ "@vitest/coverage-v8": "^4.0.6", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.29.1", "eslint-plugin-no-unsanitized": "^4.0.2", "eslint-plugin-prettier": "^5.2.1",