Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

New rule: Use matching super parameter names #4263

Merged
merged 4 commits into from
Apr 17, 2023
Merged

New rule: Use matching super parameter names #4263

merged 4 commits into from
Apr 17, 2023

Conversation

srawlins
Copy link
Contributor

@srawlins srawlins commented Apr 7, 2023

Implements the proposal at dart-lang/sdk#59104

@coveralls
Copy link

coveralls commented Apr 7, 2023

Coverage Status

Coverage: 96.421% (+0.004%) from 96.416% when pulling 556e758 on super-name-name into fffb74c on main.

@pq
Copy link
Contributor

pq commented Apr 7, 2023

I'd like to get a little more conversation on the proposal (dart-lang/sdk#59104) before landing.

@srawlins
Copy link
Contributor Author

srawlins commented Apr 7, 2023

Sounds good. Anything specific?

@pq
Copy link
Contributor

pq commented Apr 7, 2023

As per https://github.com/dart-lang/linter/blob/main/doc/lint-lifecycle.md we generally try and get a bunch of input before "accepting" a proposed lint. I'll go ahead and cc some folks who are reliably opinionated.


@override
void visitConstructorDeclaration(ConstructorDeclaration node) {
var positionalSuperParameters = node.parameters.parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be inclined to do this less idiomatically in preference of just one iteration and without all the temporary objects. (I did a series of changes that dumbed down code like this and made it measurably faster.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, parameter lists are short but I guess I think every bit counts. 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, here's an extreme motivating example: #1838

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants