Skip to content

Commit 2d8d19b

Browse files
committed
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``. In the case of the current review, this allowed me to remove the `eslint-disable` directive from two tests and reintroduce validation which was actually failing because of the missing empty line after the header. I switched the configuration to use the new config format for v3.2.x as the leading comments feature is not supported by the array-based format inherited from _eslint-plugin-header_. I've sent PR proposals to other projects in the _cloudscape-design_ space: - cloudscape-design/collection-hooks#136 - cloudscape-design/components#4308 - cloudscape-design/demos#243 - cloudscape-design/test-utils#114 Looking forward to your feedback.
1 parent 03e7cca commit 2d8d19b

File tree

5 files changed

+340
-200
lines changed

5 files changed

+340
-200
lines changed

.eslintrc

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"jsx": true
1515
}
1616
},
17-
"plugins": ["unicorn", "react-hooks", "no-unsanitized", "header", "import"],
17+
"plugins": ["unicorn", "react-hooks", "no-unsanitized", "@tony.ganchev/header", "import"],
1818
"rules": {
1919
"@typescript-eslint/no-empty-function": "off",
2020
"@typescript-eslint/no-namespace": "off",
@@ -53,11 +53,29 @@
5353
"eqeqeq": "error",
5454
"no-return-await": "error",
5555
"require-await": "error",
56-
"header/header": [
56+
"@tony.ganchev/header/header": [
5757
"error",
58-
"line",
59-
[" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.", " SPDX-License-Identifier: Apache-2.0"],
60-
2
58+
{
59+
"header": {
60+
"commentType": "line",
61+
"lines": [" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.", " SPDX-License-Identifier: Apache-2.0"]
62+
},
63+
"leadingComments": {
64+
"comments": [
65+
{
66+
"commentType": "block",
67+
"lines": [
68+
"*",
69+
" * @jest-environment node",
70+
" "
71+
]
72+
}
73+
]
74+
},
75+
"trailingEmptyLines": {
76+
"minimum": 2
77+
}
78+
}
6179
],
6280
"no-warning-comments": "warn",
6381
"import/extensions": ["error", "ignorePackages"]

0 commit comments

Comments
 (0)