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

What are the default lints enforced? #57872

Closed
jonasfj opened this issue Jan 14, 2019 · 7 comments
Closed

What are the default lints enforced? #57872

jonasfj opened this issue Jan 14, 2019 · 7 comments
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. devexp-linter Issues with the analyzer's support for the linter package type-question A question about expected behavior or functionality

Comments

@jonasfj
Copy link
Member

jonasfj commented Jan 14, 2019

What are the default lints enforced...

Reading the README I would expect to learn what happens when I run dartanalyzer. I don't configure lints for most of my projects, and just assume that some sane defaults are present.

  • Is this assumption wrong, is there no sane defaults?
  • What are the default lints?

Reading the README:

The linter gives you feedback to help you catch potential errors and keep your code in line with the published Dart Style Guide.
...
To help you choose the rules you want to enable for your package, we have provided a complete list of rules and a growing list of lints according to the Effective Dart guide.

Suggests that it might be that the defaults are:

But it's not clear to me that this is what it says. Could we possibly write a single line somewhere referencing the default lints?

@jonasfj jonasfj added the type-question A question about expected behavior or functionality label Jan 14, 2019
@pq
Copy link
Member

pq commented Jan 14, 2019

I completely agree that this is VERY confusing and it gets even worse when you look at all of the places we define implicit defaults (e.g., #57873). As suggested there, for sane defaults, I'd like to converge on package:pedantic but need to collect some feedback.

@jonasfj: what do you think?

@jonasfj
Copy link
Member Author

jonasfj commented Jan 14, 2019

what do you think?

Nice try, haha :) I'm doing my best to not think about style/linting 🙈

I mostly care that we have one set of rules we recommend (and maybe one for flutter), and that someone is willing to defend those rules.

@pq
Copy link
Member

pq commented Jan 14, 2019

I'm doing my best to not think about style/linting 🙈

🥇

I mostly care that we have one set of rules we recommend (and maybe one for flutter), and that someone is willing to defend those rules.

We're on the same page. That's exactly why I'm suggesting package:pedantic since a lot of work has gone into vetting it.

@devoncarew
Copy link
Member

Should we be running any lints of none have been configured for a project? I think I would expect no lints to be enabled; just errors and warnings.

We can guide people to best practices about which lints to have in the project creation stage - have stagehand create projects with the recommended best practices lints (ala pedantic).

@bwilkerson
Copy link
Member

Should we be running any lints of none have been configured for a project? I think I would expect no lints to be enabled; just errors and warnings.

Me too. (I thought I'd responded to the thread saying as much, but I guess I forgot to click "Comment", so I'm glad you said it.)

Lints are designed to be opt-in. I think it was a mistake to enable any lints by default, and I think we should fix that.

@jonasfj
Copy link
Member Author

jonasfj commented Jan 15, 2019

Ah, okay that's a fine opinion... I just assumed that there was some sane default set of lints it would always run, and I wanted to know what these were :)

@jonasfj jonasfj closed this as completed Jan 15, 2019
@bwilkerson
Copy link
Member

Well, there is a default set of lints, but I don't know that I'd call it sane. :-)

@devoncarew devoncarew added devexp-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Nov 18, 2024
@devoncarew devoncarew transferred this issue from dart-archive/linter Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. devexp-linter Issues with the analyzer's support for the linter package type-question A question about expected behavior or functionality
Projects
None yet
Development

No branches or pull requests

4 participants