@storm-software/eslint 0.74.0 → 0.76.0

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.
Files changed (2) hide show
  1. package/dist/preset.mjs +13 -5
  2. package/package.json +1 -1
package/dist/preset.mjs CHANGED
@@ -13446,13 +13446,21 @@ function getEOL(options) {
13446
13446
  return os.EOL;
13447
13447
  }
13448
13448
  function hasBanner(commentType, src) {
13449
- if (src.substr(0, 2) === "#!") {
13450
- const m = src.match(/(\r\n|\r|\n)/);
13451
- if (m?.index) {
13452
- src = src.slice(m.index + m[0].length);
13449
+ if (src.startsWith("#!")) {
13450
+ const bannerLines = src.split(/\r?\n/);
13451
+ if (bannerLines && bannerLines.length > 1) {
13452
+ bannerLines.shift();
13453
+ while (bannerLines.length && bannerLines[0] && !bannerLines[0].replace(/\s+/, "")) {
13454
+ bannerLines.shift();
13455
+ }
13456
+ if (bannerLines.length) {
13457
+ src = bannerLines.join("\n");
13458
+ } else {
13459
+ return false;
13460
+ }
13453
13461
  }
13454
13462
  }
13455
- return commentType === "block" && src.substr(0, 2) === "/*" || commentType === "lint" && src.substr(0, 2) === "//" || commentType !== "block" && commentType !== "lint" && src.substr(0, commentType?.length) === commentType;
13463
+ return commentType === "block" && src.startsWith("/*") || commentType === "lint" && src.startsWith("//") || commentType !== "block" && commentType !== "lint" && commentType && src.startsWith(commentType);
13456
13464
  }
13457
13465
  function matchesLineEndings(src, num) {
13458
13466
  for (let j = 0; j < num; ++j) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/eslint",
3
- "version": "0.74.0",
3
+ "version": "0.76.0",
4
4
  "type": "module",
5
5
  "description": "⚡ A package containing the base ESLint configuration used by Storm Software across many projects.",
6
6
  "repository": {