-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update dartanalyzer lint rule defaults to an empty set #57880
Comments
As I said elsewhere, I would prefer to see us remove the notion of "default" rules entirely. As far as I can tell, these defaults do not impact either the command-line analyzer or the analysis server. I'm not sure whether they impact the linter app, but I don't see any value to having them there. Do they bring some value that I'm not seeing? |
If you run sdk/pkg/analyzer/lib/src/context/builder.dart Lines 486 to 490 in cc9607b
Initially the idea of a default set of rules was introduced to make trying out linting easier. (At that point no one had any experience w/ |
That's my preference. I don't know whether it would be a breaking change from a practical perspective. It would be nice to have analytics to tell us whether anyone runs the command-line analyzer with On the other hand, changing the set of rules that we're running when someone does that is technically a breaking change whether we change it to a different non-empty set (such as pedantic) or to an empty set. So if we're going to make a breaking change, let's just remove the functionality. |
Oh, I knew you'd say that. 😄 I guess I can go either way. I'd be curious what other folks think and happy to go with the flow. As long as we change the current set of defaults to something sensible (empty or pedantic), I'm good! |
Being more restrictive would likely be a larger change from the POV of users than being less restrictive? I'm not sure what lints we have enabled by default, but dropping down to an empty set of lints enabled if nothing is specified makes sense to me. People can then opt-into the lints they want, either deliberately by adjusting their analysis options, or through pedantic if they create a new project w/ stagehand. |
I poked around the source a bit but couldn't see how or where the current default lints are defined. |
By using We might also want to make the |
Ah, thanks! For posterity, here are the current lints enabled by default:
|
SGTM. I've update the title to reflect the new plan. Thanks for the thoughtful conversation! |
Part of #57873: update the lint registry defaults
to line up with those defined bypackage:pedantic
.EDIT: as per conversation below, the new plan is to have no rules default to on.
The text was updated successfully, but these errors were encountered: