Skip to content

linter: consider reducing the size of the diagnostic message for lint rule max-lines #3961

@camc314

Description

@camc314

ctx.diagnostic(max_lines_diagnostic(
&error,
Span::new(
u32::try_from(start).unwrap_or(u32::MIN),
u32::try_from(ctx.source_text().len()).unwrap_or(u32::MAX),
),
));

currently, it will lot out every extra line to the console.

if you have a large file. e.g. 1000+. it is a lot of (im my opinion) unneccessary noise in the console.

i think it is worth considering either

  • reporting the diagnostic at the first character of the file
  • reporting the diagnostic at the first character of the first line that goes over the limt

this will make the linting diagnostics more readable for the end user

Metadata

Metadata

Assignees

Labels

A-linterArea - LinterC-bugCategory - Bug

Type

No type

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions