avoid_unnecessary_extends
v1.0.0 Warning Code Organization
This rule flags a class that explicitly extends Object.
Why use this rule
Section titled “Why use this rule”Every Dart class extends Object already, so the clause states the default while looking like a decision. A reader who sees an extends expects the superclass to matter, and has to recall that this one does not.
A class extending a user-declared Object that shadows dart:core’s is making a real choice, and is left alone.
See also: Object
class Repository extends Object {}class Repository {}Turning this rule off
Section titled “Turning this rule off”This rule is in the opinionated preset.
To disable this rule:
rules: avoid_unnecessary_extends: falseTo keep the rule on but skip certain paths, use per-rule exclude.
Related rules
Section titled “Related rules”arguments_ordering— Keep named arguments in a configured order.avoid_duplicate_mixins— Flag a mixin applied twice in onewithclause.avoid_generics_shadowing— Avoid generic type parameters that shadow top-level declarations.avoid_unnecessary_constructor— Remove a constructor identical to the default one.