eslint 8.4.0 → 8.4.1

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.
@@ -80,7 +80,7 @@ module.exports = {
80
80
  OPTIONS_OR_INTEGER_SCHEMA
81
81
  ],
82
82
  messages: {
83
- exceed: "{{name}} has exceeded the limit of lines allowed by {{linesExceed}}. Maximum allowed number of lines per function is {{maxLines}}."
83
+ exceed: "{{name}} has too many lines ({{lineCount}}). Maximum allowed is {{maxLines}}."
84
84
  }
85
85
  },
86
86
 
@@ -170,26 +170,18 @@ module.exports = {
170
170
  return;
171
171
  }
172
172
  let lineCount = 0;
173
- let comments = 0;
174
- let blankLines = 0;
175
173
 
176
174
  for (let i = node.loc.start.line - 1; i < node.loc.end.line; ++i) {
177
175
  const line = lines[i];
178
176
 
179
177
  if (skipComments) {
180
178
  if (commentLineNumbers.has(i + 1) && isFullLineComment(line, i + 1, commentLineNumbers.get(i + 1))) {
181
- if (lineCount <= maxLines) {
182
- comments++;
183
- }
184
179
  continue;
185
180
  }
186
181
  }
187
182
 
188
183
  if (skipBlankLines) {
189
184
  if (line.match(/^\s*$/u)) {
190
- if (lineCount <= maxLines) {
191
- blankLines++;
192
- }
193
185
  continue;
194
186
  }
195
187
  }
@@ -199,21 +191,11 @@ module.exports = {
199
191
 
200
192
  if (lineCount > maxLines) {
201
193
  const name = upperCaseFirst(astUtils.getFunctionNameWithKind(funcNode));
202
- const linesExceed = lineCount - maxLines;
203
-
204
- const loc = {
205
- start: {
206
- line: node.loc.start.line + maxLines + (comments + blankLines),
207
- column: 0
208
- },
209
- end: node.loc.end
210
- };
211
194
 
212
195
  context.report({
213
196
  node,
214
- loc,
215
197
  messageId: "exceed",
216
- data: { name, linesExceed, maxLines }
198
+ data: { name, lineCount, maxLines }
217
199
  });
218
200
  }
219
201
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint",
3
- "version": "8.4.0",
3
+ "version": "8.4.1",
4
4
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
5
5
  "description": "An AST-based pattern checker for JavaScript.",
6
6
  "bin": {