eslint-plugin-jsdoc 65.0.1 → 65.0.2

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/package.json CHANGED
@@ -163,5 +163,5 @@
163
163
  "test-cov": "TIMING=1 c8 --reporter text pnpm run test-no-cov",
164
164
  "test-index": "pnpm run test-no-cov test/rules/index.js"
165
165
  },
166
- "version": "65.0.1"
166
+ "version": "65.0.2"
167
167
  }
@@ -25,16 +25,6 @@ const maskCodeBlocks = (str) => {
25
25
  });
26
26
  };
27
27
 
28
- /**
29
- * @param {string[]} lines
30
- * @param {number} lineIndex
31
- * @returns {number}
32
- */
33
- const getLineNumber = (lines, lineIndex) => {
34
- const precedingText = lines.slice(0, lineIndex).join('\n');
35
- return precedingText.split('\n').length;
36
- };
37
-
38
28
  export default iterateJsdoc(({
39
29
  context,
40
30
  jsdocNode,
@@ -75,7 +65,7 @@ export default iterateJsdoc(({
75
65
  // Check for no space between the asterisk prefix and content
76
66
  if (!allowNoSpaceAfterAsterisk && /^(?:\/?\**|[\t ]*)\*[^\s*\/]/v.test(line)) {
77
67
  report('There must be a space after the asterisk.', null, {
78
- line: getLineNumber(lines, lineIndex),
68
+ line: lineIndex,
79
69
  });
80
70
  return;
81
71
  }
@@ -91,7 +81,7 @@ export default iterateJsdoc(({
91
81
  // If this is a tag line with indentation, always report
92
82
  if (/^@\w+/v.test(afterIndent)) {
93
83
  report('There must be no indentation.', null, {
94
- line: getLineNumber(lines, lineIndex),
84
+ line: lineIndex,
95
85
  });
96
86
  return;
97
87
  }
@@ -99,7 +89,7 @@ export default iterateJsdoc(({
99
89
  // If we haven't seen any content yet (main description first line) and there's content, report
100
90
  if (!hasSeenContent && afterIndent.trim().length > 0) {
101
91
  report('There must be no indentation.', null, {
102
- line: getLineNumber(lines, lineIndex),
92
+ line: lineIndex,
103
93
  });
104
94
  return;
105
95
  }
@@ -112,7 +102,7 @@ export default iterateJsdoc(({
112
102
  } else if (indentAmount < currentSectionIndent) {
113
103
  // Indentation is less than the established level (inconsistent)
114
104
  report('There must be no indentation.', null, {
115
- line: getLineNumber(lines, lineIndex),
105
+ line: lineIndex,
116
106
  });
117
107
  return;
118
108
  }