New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oxlint: max-lines should not display offending code #2775
Comments
Thank you, what will it display now? |
Honestly it isn't necessary to display any lines. Because if the file is too long, we can easily end up moving entire functions, and it would be sheer luck if they happened to be at the end of the file. So I would submit that showing excess lines is not at all helpful in most cases to the process of shortening the file. |
I agree with this, so initially I think it is OK to report all lines and let the user choose which part needs to be deleted. after all, people open this rule, they need to fix it, although it does get a little annoying.
I think some people will encounter this error when they are writing code in this file line by line, it's friendly to notice them they write too many lines, they may decide to write remain part in another file. Look through ESLint's issue about max-line, not find folk's report about this(perhaps I missed it), I think we can follow the ESLint behavior for now. |
Fair enough. Then how about adding a config option to not display the offending lines? |
When
max-lines
fails, it displays the entire file — which could be several hundred lines — as offending code. This is clearly unnecessary and undesirable.The text was updated successfully, but these errors were encountered: