@tony.ganchev/eslint-plugin-header 3.3.2 → 3.3.3

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.
@@ -964,11 +964,20 @@ const headerRule = {
964
964
  Program: function () {
965
965
  const sourceCode = contextSourceCode(context);
966
966
  const leadingComments = getLeadingComments(sourceCode);
967
- const hasShebang = leadingComments.length > 0
968
- && /** @type {string} */ (leadingComments[0][0].type) === "Shebang";
967
+ // XXX: the reason we test like this instead of checking the
968
+ // first comment is of type "Shabeng" is because
969
+ // @typecript-eslint/prser does not recognize shebang comments
970
+ // with some TypeScript configuration. Since we are not
971
+ // releasing a major version we do not want to break the current
972
+ // behavior of not be pedantic about the tsconfig.json.
973
+ const hasShebang = sourceCode.text.startsWith("#!");
969
974
  let startingHeaderLine = 1;
970
975
  if (hasShebang) {
971
- leadingComments.splice(0, 1);
976
+ if (leadingComments.length > 0
977
+ && /** @type {string} */ (leadingComments[0][0].type) === "Shebang"
978
+ ) {
979
+ leadingComments.splice(0, 1);
980
+ }
972
981
  startingHeaderLine = 2;
973
982
  }
974
983
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tony.ganchev/eslint-plugin-header",
3
- "version": "3.3.2",
3
+ "version": "3.3.3",
4
4
  "description": "The native ESLint 9/10 header plugin. A zero-bloat, drop-in replacement for 'eslint-plugin-header' with first-class Flat Config & TypeScript support. Auto-fix Copyright, License, and banner comments in JavaScrip and TypeScript files.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1 +1 @@
1
- {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../lib/rules/header.js"],"names":[],"mappings":";2BAsCa,iBAAiB;0BACjB,gBAAgB;wBAChB,cAAc;0BACd,gBAAgB;;;;;yBAIhB,IAAI,GAAG,MAAM;;;;;;;;;;aAOZ,MAAM,GAAG,MAAM;;;;;;;;;;;;yBAOhB,MAAM,GAAG,MAAM,GAAG,iBAA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