From 5f2d2fe62230663a418a5b3e21917a84a34df899 Mon Sep 17 00:00:00 2001 From: Tony Ganchev Date: Mon, 16 Mar 2026 12:47:27 +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/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/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 | 21 +++++++++++---------- package.json | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.eslintrc b/.eslintrc index a59462e..0593a71 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,14 +5,14 @@ "ecmaVersion": 2018, "sourceType": "module" }, - "plugins": ["@typescript-eslint", "unicorn", "header"], + "plugins": ["@typescript-eslint", "unicorn", "@tony.ganchev/header"], "rules": { "unicorn/filename-case": "error", "@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/camelcase": "off", "@typescript-eslint/no-inferrable-types": "off", "curly": "error", - "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 8c30991..3f6f947 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "webdriverio": "^9.24.0" }, "devDependencies": { + "@tony.ganchev/eslint-plugin-header": "^3.3.1", "@types/lodash": "^4.14.186", "@types/node": "^18.0.0", "@types/pixelmatch": "^5.2.4", @@ -30,7 +31,6 @@ "@vitest/coverage-istanbul": "^3.0.7", "eslint": "^8.26.0", "eslint-config-prettier": "^8.5.0", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-unicorn": "^44.0.2", "glob": "^10.5.0", @@ -2686,6 +2686,16 @@ "node": ">=18.0.0" } }, + "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", @@ -4861,15 +4871,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": "4.2.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", diff --git a/package.json b/package.json index 7336277..de5e1b5 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "webdriverio": "^9.24.0" }, "devDependencies": { + "@tony.ganchev/eslint-plugin-header": "^3.3.1", "@types/lodash": "^4.14.186", "@types/node": "^18.0.0", "@types/pixelmatch": "^5.2.4", @@ -50,7 +51,6 @@ "@vitest/coverage-istanbul": "^3.0.7", "eslint": "^8.26.0", "eslint-config-prettier": "^8.5.0", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-unicorn": "^44.0.2", "glob": "^10.5.0",