@storm-software/eslint 0.170.92 → 0.170.93

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/dist/preset.cjs CHANGED
@@ -5867,7 +5867,9 @@ function excludeShebangs(comments) {
5867
5867
  function getLeadingComments(context, node2) {
5868
5868
  const firstBodyNode = Array.isArray(node2.body) && node2.body.length ? node2.body[0] : node2;
5869
5869
  const all = excludeShebangs(
5870
- context.getSourceCode().getAllComments(firstBodyNode)
5870
+ (context.sourceCode || context.getSourceCode()).getAllComments(
5871
+ firstBodyNode
5872
+ )
5871
5873
  );
5872
5874
  if (!all.length) {
5873
5875
  return [];
@@ -5882,7 +5884,7 @@ function getLeadingComments(context, node2) {
5882
5884
  if (!prev || !current) {
5883
5885
  break;
5884
5886
  }
5885
- const txt = context.getSourceCode().getText().slice(prev.range[1], current.range[0]);
5887
+ const txt = (context.sourceCode || context.getSourceCode()).getText().slice(prev.range[1], current.range[0]);
5886
5888
  if (!txt.match(/^(\r\n|\r|\n)$/)) {
5887
5889
  break;
5888
5890
  }
@@ -5903,7 +5905,7 @@ function genCommentsRange(context, comments, eol) {
5903
5905
  }
5904
5906
  const start = comments[0].range[0];
5905
5907
  let end = comments.slice(-1)[0]?.range[1] ?? start;
5906
- if (context.getSourceCode().text[end] === eol) {
5908
+ if ((context.sourceCode || context.getSourceCode()).text[end] === eol) {
5907
5909
  end += eol.length;
5908
5910
  }
5909
5911
  return [start, end];
@@ -6063,7 +6065,11 @@ var banner_default = createRule({
6063
6065
  return {
6064
6066
  Program(node2) {
6065
6067
  const normalizedNewlines = newlines ?? 1;
6066
- if (!hasBanner(normalizedCommentStyle, context.sourceCode.getText(), eol)) {
6068
+ if (!hasBanner(
6069
+ normalizedCommentStyle,
6070
+ (context.sourceCode || context.getSourceCode()).getText(),
6071
+ eol
6072
+ )) {
6067
6073
  context.report({
6068
6074
  loc: node2.loc,
6069
6075
  messageId: "missingBanner",
@@ -6164,7 +6170,7 @@ var banner_default = createRule({
6164
6170
  if (!lastLeadingComment) {
6165
6171
  return;
6166
6172
  }
6167
- const postLineBanner = context.sourceCode.text.substr(
6173
+ const postLineBanner = (context.sourceCode || context.getSourceCode()).text.substr(
6168
6174
  lastLeadingComment.range[1],
6169
6175
  normalizedNewlines * 2
6170
6176
  );
@@ -6217,7 +6223,7 @@ var banner_default = createRule({
6217
6223
  )
6218
6224
  });
6219
6225
  } else {
6220
- const postBlockBanner = context.sourceCode.text.substr(
6226
+ const postBlockBanner = (context.sourceCode || context.getSourceCode()).text.substr(
6221
6227
  firstLeadingComment2.range[1],
6222
6228
  normalizedNewlines * 2
6223
6229
  );
package/dist/preset.js CHANGED
@@ -5726,7 +5726,9 @@ function excludeShebangs(comments) {
5726
5726
  function getLeadingComments(context, node2) {
5727
5727
  const firstBodyNode = Array.isArray(node2.body) && node2.body.length ? node2.body[0] : node2;
5728
5728
  const all = excludeShebangs(
5729
- context.getSourceCode().getAllComments(firstBodyNode)
5729
+ (context.sourceCode || context.getSourceCode()).getAllComments(
5730
+ firstBodyNode
5731
+ )
5730
5732
  );
5731
5733
  if (!all.length) {
5732
5734
  return [];
@@ -5741,7 +5743,7 @@ function getLeadingComments(context, node2) {
5741
5743
  if (!prev || !current) {
5742
5744
  break;
5743
5745
  }
5744
- const txt = context.getSourceCode().getText().slice(prev.range[1], current.range[0]);
5746
+ const txt = (context.sourceCode || context.getSourceCode()).getText().slice(prev.range[1], current.range[0]);
5745
5747
  if (!txt.match(/^(\r\n|\r|\n)$/)) {
5746
5748
  break;
5747
5749
  }
@@ -5762,7 +5764,7 @@ function genCommentsRange(context, comments, eol) {
5762
5764
  }
5763
5765
  const start = comments[0].range[0];
5764
5766
  let end = comments.slice(-1)[0]?.range[1] ?? start;
5765
- if (context.getSourceCode().text[end] === eol) {
5767
+ if ((context.sourceCode || context.getSourceCode()).text[end] === eol) {
5766
5768
  end += eol.length;
5767
5769
  }
5768
5770
  return [start, end];
@@ -5922,7 +5924,11 @@ var banner_default = createRule({
5922
5924
  return {
5923
5925
  Program(node2) {
5924
5926
  const normalizedNewlines = newlines ?? 1;
5925
- if (!hasBanner(normalizedCommentStyle, context.sourceCode.getText(), eol)) {
5927
+ if (!hasBanner(
5928
+ normalizedCommentStyle,
5929
+ (context.sourceCode || context.getSourceCode()).getText(),
5930
+ eol
5931
+ )) {
5926
5932
  context.report({
5927
5933
  loc: node2.loc,
5928
5934
  messageId: "missingBanner",
@@ -6023,7 +6029,7 @@ var banner_default = createRule({
6023
6029
  if (!lastLeadingComment) {
6024
6030
  return;
6025
6031
  }
6026
- const postLineBanner = context.sourceCode.text.substr(
6032
+ const postLineBanner = (context.sourceCode || context.getSourceCode()).text.substr(
6027
6033
  lastLeadingComment.range[1],
6028
6034
  normalizedNewlines * 2
6029
6035
  );
@@ -6076,7 +6082,7 @@ var banner_default = createRule({
6076
6082
  )
6077
6083
  });
6078
6084
  } else {
6079
- const postBlockBanner = context.sourceCode.text.substr(
6085
+ const postBlockBanner = (context.sourceCode || context.getSourceCode()).text.substr(
6080
6086
  firstLeadingComment2.range[1],
6081
6087
  normalizedNewlines * 2
6082
6088
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/eslint",
3
- "version": "0.170.92",
3
+ "version": "0.170.93",
4
4
  "private": false,
5
5
  "description": "A package containing the base ESLint configuration used by Storm Software across many projects.",
6
6
  "keywords": [
@@ -196,7 +196,7 @@
196
196
  "@next/eslint-plugin-next": "^15.5.19",
197
197
  "@nx/eslint": "22.7.5",
198
198
  "@prettier/plugin-xml": "^3.4.2",
199
- "@storm-software/eslint-plugin-banner": "^0.0.25",
199
+ "@storm-software/eslint-plugin-banner": "0.0.26",
200
200
  "@storm-software/eslint-plugin-pnpm": "^0.0.24",
201
201
  "@storm-software/eslint-plugin-tsdoc": "^0.0.24",
202
202
  "@stylistic/eslint-plugin-migrate": "^4.4.1",
@@ -271,5 +271,5 @@
271
271
  "zod": { "optional": true }
272
272
  },
273
273
  "publishConfig": { "access": "public" },
274
- "gitHead": "9922d1f0f3307b6823f994db8545e164984c8be7"
274
+ "gitHead": "679dea48cf6192e6df471e5d9b810c7828a96b89"
275
275
  }