diff --git a/.eslintrc b/.eslintrc index e3923f11..f371f43a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -16,7 +16,7 @@ "jsx": true, }, }, - "plugins": ["unicorn", "react-hooks", "no-unsanitized", "header", "import", "simple-import-sort", "@vitest"], + "plugins": ["unicorn", "react-hooks", "no-unsanitized", "@tony.ganchev/header", "import", "simple-import-sort", "@vitest"], "rules": { "@typescript-eslint/no-unused-vars": "error", "@typescript-eslint/consistent-type-definitions": ["error", "interface"], @@ -54,11 +54,25 @@ "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: Apache-2.0"], - 2, + { + "header" : { + "commentType": "line", + "lines": [" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.", " SPDX-License-Identifier: Apache-2.0"] + }, + "leadingComments": { + "comments": [ + { + "commentType": "block", + "lines": [" eslint-env node "] + } + ] + }, + "trailingEmptyLines": { + "minimum": 2 + } + } ], "no-restricted-imports": [ "error", diff --git a/package-lock.json b/package-lock.json index 4f146306..909710d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "@cloudscape-design/theming-build": "^1", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^15.0.7", + "@tony.ganchev/eslint-plugin-header": "^3.3.1", "@types/jest-image-snapshot": "^6.1.0", "@types/lodash": "^4.17.16", "@types/node": "^18.19.4", @@ -41,7 +42,6 @@ "delay-cli": "^2.0.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.26.0", "eslint-plugin-no-unsanitized": "^4.0.2", "eslint-plugin-prettier": "^5.1.3", @@ -4041,6 +4041,16 @@ } } }, + "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", @@ -7862,16 +7872,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 abb1e3b2..39767320 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ "@cloudscape-design/theming-build": "^1", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^15.0.7", + "@tony.ganchev/eslint-plugin-header": "^3.3.1", "@types/jest-image-snapshot": "^6.1.0", "@types/lodash": "^4.17.16", "@types/node": "^18.19.4", @@ -91,7 +92,6 @@ "delay-cli": "^2.0.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.26.0", "eslint-plugin-no-unsanitized": "^4.0.2", "eslint-plugin-prettier": "^5.1.3", diff --git a/src/__tests__/utils.ts b/src/__tests__/utils.ts index a4359d70..76f2fa42 100644 --- a/src/__tests__/utils.ts +++ b/src/__tests__/utils.ts @@ -1,5 +1,4 @@ /* eslint-env node */ -/* eslint-disable header/header */ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0