Skip to content
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

Issue Report: Dart Analyzer and Linter #5922

Closed
1 task
Sushant2171993 opened this issue Jun 18, 2024 · 2 comments
Closed
1 task

Issue Report: Dart Analyzer and Linter #5922

Sushant2171993 opened this issue Jun 18, 2024 · 2 comments
Labels
act.question Relates to issues that writers need SME help from.user Issue raised by user infra.design Relates to the design of docs.Dart.dev

Comments

@Sushant2171993
Copy link

Describe the problem

Issue Report: Dart Analyzer and Linter

The current line length limit of 80 characters enforced by the Dart analyzer and linter creates significant empty space on the screen, disrupting readability and efficient use of screen real estate. A more practical limit would be 120 characters, which balances readability and effective use of space.

Could we update the limit to 120 characters or implement a linter configuration that supports this adjustment?

For reference, see the official Dart documentation on line length limits: lines_longer_than_80_chars.

Expected fix

The current Dart lint rule lines_longer_than_80_chars limits line length to 80 characters. I am requesting a configuration option or a new lint rule, such as lines_longer_than_120_chars, to allow line lengths up to 120 characters for better formatting flexibility.

On which browser(s) did you experience this issue?

No response

Additional context

No response

I would like to fix this problem.

  • I will try and fix this problem on dart.dev.
@Sushant2171993 Sushant2171993 added from.user Issue raised by user infra.design Relates to the design of docs.Dart.dev labels Jun 18, 2024
@atsansone
Copy link
Contributor

@kenzieschmoll : Is this a dart-lang/tools issue?

@atsansone atsansone added the act.question Relates to issues that writers need SME help label Jun 24, 2024
@parlough
Copy link
Member

parlough commented Jun 24, 2024

Thanks for opening the issue and the suggestion!

Effective Dart will likely continue to recommend 80 characters and if you're interested in discussion around this suggestion or changes to the dart format tool, check out dart-lang/dart_style#833 and/or dart-lang/dart_style#918 where more discussion has and continues to take place.

As for the lint rule, unless dart format makes one or more of those adjustments, the linter is unlikely to add a separate rule for other lengths, as configuration of lints is unsupported currently and different teams may desire different character limits. So I'll close this issue in favor of further discussion there.

If the base analysis options set you rely on brings in this specific lint, you can always disable it in your analysis_options.yaml file like:

linter:
  rules:
    lines_longer_than_80_chars: false

If a larger limit configured in analysis and formatting is important to you or your team, consider third-party tools like Dart Code Metrics, which among many other features, includes a formatter with line length configuration.

Thanks again :)

@parlough parlough closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
act.question Relates to issues that writers need SME help from.user Issue raised by user infra.design Relates to the design of docs.Dart.dev
Projects
None yet
Development

No branches or pull requests

3 participants