From ea5d765d5e3dca91d1f4fe46d1bc81ca2ecb59ad Mon Sep 17 00:00:00 2001 From: Tony Ganchev Date: Sun, 15 Mar 2026 21:55:20 +0200 Subject: [PATCH] chore: switch to @tony.ganchev/eslint-plugin-header Hi, team, I noticed you are using _eslint-plugin-header_ with the schema-turn-off workaround to support ESLint 9. I forked _@tony.ganchev/eslint-plugin-header_ mid-2024 to address this issue 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/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/theming-core/pull/148 Looking forward to your feedback. --- eslint.config.mjs | 5 +---- package-lock.json | 22 +++++++++++----------- package.json | 2 +- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index a09090f..5d914ce 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { includeIgnoreFile } from "@eslint/compat"; import eslint from "@eslint/js"; -import headerPlugin from "eslint-plugin-header"; +import headerPlugin from "@tony.ganchev/eslint-plugin-header"; import noUnsanitizedPlugin from "eslint-plugin-no-unsanitized"; import eslintPrettier from "eslint-plugin-prettier/recommended"; import reactPlugin from "eslint-plugin-react"; @@ -15,9 +15,6 @@ import tsEslint from "typescript-eslint"; import cloudscapeCommonRules from "@cloudscape-design/build-tools/eslint/index.js"; -// https://github.com/Stuk/eslint-plugin-header/issues/57 -headerPlugin.rules.header.meta.schema = false; - export default tsEslint.config( includeIgnoreFile(path.resolve(".gitignore")), { diff --git a/package-lock.json b/package-lock.json index 581f036..d334267 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "@size-limit/preset-small-lib": "^11.2.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", + "@tony.ganchev/eslint-plugin-header": "^3.3.1", "@types/jest-image-snapshot": "^6.1.0", "@types/lodash": "^4.14.191", "@types/node": "^20.17.14", @@ -37,7 +38,6 @@ "chokidar-cli": "^3.0.0", "eslint": "^9.20.1", "eslint-config-prettier": "^10.1.5", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.32.0", "eslint-plugin-no-unsanitized": "^4.1.2", "eslint-plugin-prettier": "^5.2.3", @@ -4218,6 +4218,16 @@ "react-dom": "^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", @@ -7858,16 +7868,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 2fc39f0..a2bd53e 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,7 @@ "@size-limit/preset-small-lib": "^11.2.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", + "@tony.ganchev/eslint-plugin-header": "^3.3.1", "@types/jest-image-snapshot": "^6.1.0", "@types/lodash": "^4.14.191", "@types/node": "^20.17.14", @@ -97,7 +98,6 @@ "chokidar-cli": "^3.0.0", "eslint": "^9.20.1", "eslint-config-prettier": "^10.1.5", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.32.0", "eslint-plugin-no-unsanitized": "^4.1.2", "eslint-plugin-prettier": "^5.2.3",