Skip to content

unnecessary_getters_setters should catch wrapping a private final field #58119

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

Open
natebosch opened this issue Jan 31, 2020 · 2 comments
Open
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-linter Issues with the analyzer's support for the linter package linter-false-negative linter-lint-request linter-set-recommended P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@natebosch
Copy link
Member

Bad:

class Foo {
  final _foo = 'foo';
  String get foo => _foo; // unnecessary_getters_setters
}

Good:

class Foo {
  final foo = 'foo';
}
@bwilkerson
Copy link
Member

I'm not sure why, but we appear to have a separate lint for that (unnecessary_getters).

@pq
Copy link
Member

pq commented Sep 30, 2021

It looks like unnecessary_getters is disabled (see: #57169). Not sure if we want to resuscitate it but I'm happy to discuss.

@devoncarew devoncarew added devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. labels Nov 18, 2024
@devoncarew devoncarew transferred this issue from dart-archive/linter Nov 18, 2024
@pq pq added the P3 A lower priority bug or feature request label Nov 20, 2024
@bwilkerson bwilkerson added area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. and removed legacy-area-analyzer Use area-devexp instead. labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-linter Issues with the analyzer's support for the linter package linter-false-negative linter-lint-request linter-set-recommended P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants