From b0dda4b5fede12590c67295bacbc8a92570890c5 Mon Sep 17 00:00:00 2001 From: Tony Ganchev Date: Fri, 27 Feb 2026 08:51:13 +0200 Subject: [PATCH] devops: swtich to @tony.ganchev/eslint-plugin-header eslint-plugin-header has not seen any updates for 4+ years. The new forked version natively supports ESLint 9 and has tons of bug-fixes and improvements. Switched to the new config format but can revert to the old one (v3.1.x) to simplify transition. --- eslint.config.mjs | 16 ++++--- package-lock.json | 120 +++++++++++++--------------------------------- package.json | 2 +- 3 files changed, 43 insertions(+), 95 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index ee54c8c7ce..e915aec6a4 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 jestPlugin from 'eslint-plugin-jest'; import noUnsanitizedPlugin from 'eslint-plugin-no-unsanitized'; import eslintPrettier from 'eslint-plugin-prettier/recommended'; @@ -18,9 +18,6 @@ import cloudscapeCommonRules from '@cloudscape-design/build-tools/eslint/index.j import cloudscapeComponentsRules from './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')), { @@ -112,8 +109,15 @@ export default tsEslint.config( 'require-await': 'error', 'header/header': [ 'error', - 'line', - [' Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.', ' SPDX-License-Identifier: Apache-2.0'], + { + header: { + commentType: 'line', + lines: [ + ' Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.', + ' SPDX-License-Identifier: Apache-2.0', + ], + }, + }, ], 'no-warning-comments': 'warn', 'simple-import-sort/imports': [ diff --git a/package-lock.json b/package-lock.json index 66823ea2d9..7816220e44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "date-fns": "^2.25.0", "intl-messageformat": "^10.3.1", "mnth": "^2.0.0", - "react-keyed-flatten-children": "^2.2.1", + "react-is": "^18.2.0", "react-transition-group": "^4.4.2", "tslib": "^2.4.0", "weekstart": "^1.1.0" @@ -44,6 +44,7 @@ "@size-limit/preset-small-lib": "^11.2.0", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^12.1.5", + "@tony.ganchev/eslint-plugin-header": "^3.2.4", "@tsconfig/node16": "^16.1.1", "@types/balanced-match": "^1.0.1", "@types/d3-scale": "^2.2.6", @@ -53,6 +54,7 @@ "@types/node": "^20.17.14", "@types/react": "^16.14.20", "@types/react-dom": "^16.9.14", + "@types/react-is": "^18.2.0", "@types/react-router": "^5.1.18", "@types/react-router-dom": "^5.3.2", "@types/react-test-renderer": "^16.9.12", @@ -69,7 +71,6 @@ "d3-scale": "^4.0.2", "eslint": "^9.20.1", "eslint-config-prettier": "^10.1.5", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-jest": "^28.11.0", "eslint-plugin-no-unsanitized": "^4.1.2", "eslint-plugin-prettier": "^5.2.3", @@ -2397,11 +2398,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@jest/core/node_modules/react-is": { - "version": "18.3.1", - "dev": true, - "license": "MIT" - }, "node_modules/@jest/core/node_modules/strip-ansi": { "version": "6.0.1", "dev": true, @@ -4239,6 +4235,16 @@ "react-dom": "<18.0.0" } }, + "node_modules/@tony.ganchev/eslint-plugin-header": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@tony.ganchev/eslint-plugin-header/-/eslint-plugin-header-3.2.4.tgz", + "integrity": "sha512-zqMKTW/KQmqKGINkhwEPoJFcJ0ewUkUAmvzHLB5N+n/6bsk7D/xkQ50VhUakG2P4JHHtqsncaXrPxgSeuBPmOw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": ">=7.7.0" + } + }, "node_modules/@tootallnate/once": { "version": "2.0.0", "dev": true, @@ -4504,11 +4510,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@types/jest/node_modules/react-is": { - "version": "18.3.1", - "dev": true, - "license": "MIT" - }, "node_modules/@types/jsdom": { "version": "20.0.1", "dev": true, @@ -4591,6 +4592,16 @@ "@types/react": "^16" } }, + "node_modules/@types/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-zts4lhQn5ia0cF/y2+3V6Riu0MAfez9/LJYavdM8TvcVl+S91A/7VWxyBT8hbRuWspmuCaiGI0F41OJYGrKhRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "^18" + } + }, "node_modules/@types/react-router": { "version": "5.1.20", "dev": true, @@ -9114,14 +9125,6 @@ "eslint": ">=7.0.0" } }, - "node_modules/eslint-plugin-header": { - "version": "3.1.1", - "dev": true, - "license": "MIT", - "peerDependencies": { - "eslint": ">=7.7.0" - } - }, "node_modules/eslint-plugin-jest": { "version": "28.14.0", "dev": true, @@ -9938,14 +9941,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/expect-webdriverio/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT", - "peer": true - }, "node_modules/express": { "version": "4.22.1", "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz", @@ -12818,11 +12813,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-circus/node_modules/react-is": { - "version": "18.3.1", - "dev": true, - "license": "MIT" - }, "node_modules/jest-cli": { "version": "29.7.0", "dev": true, @@ -13040,11 +13030,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-config/node_modules/react-is": { - "version": "18.3.1", - "dev": true, - "license": "MIT" - }, "node_modules/jest-diff": { "version": "29.7.0", "dev": true, @@ -13098,11 +13083,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-diff/node_modules/react-is": { - "version": "18.3.1", - "dev": true, - "license": "MIT" - }, "node_modules/jest-docblock": { "version": "29.7.0", "dev": true, @@ -13168,11 +13148,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-each/node_modules/react-is": { - "version": "18.3.1", - "dev": true, - "license": "MIT" - }, "node_modules/jest-environment-jsdom": { "version": "29.7.0", "dev": true, @@ -13311,11 +13286,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-leak-detector/node_modules/react-is": { - "version": "18.3.1", - "dev": true, - "license": "MIT" - }, "node_modules/jest-matcher-utils": { "version": "29.7.0", "dev": true, @@ -13369,11 +13339,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-matcher-utils/node_modules/react-is": { - "version": "18.3.1", - "dev": true, - "license": "MIT" - }, "node_modules/jest-message-util": { "version": "29.7.0", "dev": true, @@ -13432,11 +13397,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-message-util/node_modules/react-is": { - "version": "18.3.1", - "dev": true, - "license": "MIT" - }, "node_modules/jest-mock": { "version": "29.7.0", "dev": true, @@ -13740,11 +13700,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-snapshot/node_modules/react-is": { - "version": "18.3.1", - "dev": true, - "license": "MIT" - }, "node_modules/jest-snapshot/node_modules/semver": { "version": "7.7.2", "dev": true, @@ -13864,11 +13819,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-validate/node_modules/react-is": { - "version": "18.3.1", - "dev": true, - "license": "MIT" - }, "node_modules/jest-watcher": { "version": "29.7.0", "dev": true, @@ -16998,6 +16948,13 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/pretty-format/node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true, + "license": "MIT" + }, "node_modules/process": { "version": "0.11.10", "dev": true, @@ -17412,22 +17369,9 @@ } }, "node_modules/react-is": { - "version": "17.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/react-keyed-flatten-children": { - "version": "2.2.1", - "license": "MIT", - "dependencies": { - "react-is": "^18.2.0" - }, - "peerDependencies": { - "react": ">=15.0.0" - } - }, - "node_modules/react-keyed-flatten-children/node_modules/react-is": { "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "license": "MIT" }, "node_modules/react-router": { diff --git a/package.json b/package.json index 5e0c145c9f..6d6854cb3f 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "@size-limit/preset-small-lib": "^11.2.0", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^12.1.5", + "@tony.ganchev/eslint-plugin-header": "^3.2.4", "@tsconfig/node16": "^16.1.1", "@types/balanced-match": "^1.0.1", "@types/d3-scale": "^2.2.6", @@ -93,7 +94,6 @@ "d3-scale": "^4.0.2", "eslint": "^9.20.1", "eslint-config-prettier": "^10.1.5", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-jest": "^28.11.0", "eslint-plugin-no-unsanitized": "^4.1.2", "eslint-plugin-prettier": "^5.2.3",