@adobe/eslint-config-helix 3.0.32 → 3.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [3.0.34](https://github.com/adobe/helix-eslint-config/compare/v3.0.33...v3.0.34) (2026-11-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **header:** find header comment independent of Program range ([df8f1e8](https://github.com/adobe/helix-eslint-config/commit/df8f1e8ae5b1967bcca9b3c27b0483f9c1bd7ca7)), closes [typescript-eslint/typescript-eslint#12991](https://github.com/typescript-eslint/typescript-eslint/issues/12991)
7
+
8
+ ## [3.0.33](https://github.com/adobe/helix-eslint-config/compare/v3.0.32...v3.0.33) (2026-10-20)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependency globals to v17.13.0 ([#276](https://github.com/adobe/helix-eslint-config/issues/276)) ([60fa298](https://github.com/adobe/helix-eslint-config/commit/60fa298e8280bcb44017f9c7b24c6365535d2e0f))
14
+
1
15
  ## [3.0.32](https://github.com/adobe/helix-eslint-config/compare/v3.0.31...v3.0.32) (2026-09-22)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/eslint-config-helix",
3
- "version": "3.0.32",
3
+ "version": "3.0.34",
4
4
  "description": "Helix's ESLint config, based on Airbnb's style guide",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -8,7 +8,7 @@
8
8
  "lint": "./node_modules/.bin/eslint .",
9
9
  "semantic-release-dry": "semantic-release --dry-run --branches $CI_BRANCH",
10
10
  "semantic-release": "semantic-release",
11
- "test": "npm run lint"
11
+ "test": "node --test"
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
@@ -28,11 +28,12 @@
28
28
  "dependencies": {
29
29
  "@eslint/config-helpers": "0.7.0",
30
30
  "eslint-plugin-import": "2.32.0",
31
- "globals": "17.12.0"
31
+ "globals": "17.13.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@semantic-release/changelog": "7.0.0",
35
35
  "@semantic-release/git": "11.0.1",
36
+ "@typescript-eslint/parser": "8.72.2",
36
37
  "eslint": "9.39.5",
37
38
  "semantic-release": "25.0.9"
38
39
  },
package/rules/header.js CHANGED
@@ -30,14 +30,21 @@ function headerMatches(expected, actual) {
30
30
  }
31
31
 
32
32
  /**
33
- * Returns the header comment.
33
+ * Returns the header comment, i.e. the first block comment that precedes the first token
34
+ * of the program (ignoring a leading shebang).
35
+ *
36
+ * Note: we cannot use `sourceCode.getCommentsBefore(program)`, since some parsers (e.g.
37
+ * `@typescript-eslint/parser` >= 8.72) include leading comments in the `Program` range.
34
38
  *
35
39
  * @param {Program} program program node
36
40
  * @param {import('eslint').Rule.RuleContext} context rule context
37
41
  * @returns header comment or null
38
42
  */
39
43
  function getHeaderComment(program, context) {
40
- const comments = context.sourceCode.getCommentsBefore(program);
44
+ const { sourceCode } = context;
45
+ const firstToken = sourceCode.getFirstToken(program);
46
+ const comments = sourceCode.getAllComments()
47
+ .filter((comment) => !firstToken || comment.range[1] <= firstToken.range[0]);
41
48
  if (!comments.length) {
42
49
  return null;
43
50
  }