Skip to main content

Rules

Rules are grouped by category to help you understand their purpose. Each rule has emojis denoting:

  • ✅ - this rule is included into the "recommended" preset
  • ⚙️ - this rule is configurable
  • 🛠 - some problems reported by this rule can be fixed by editor suggestions or by CLI fixes
Categories
All
Tags
All
Severities
All
Versions
All
Config
Unset
Fixes
Unset
Presets
All
Plans
All
Total Rules: 406

Common 283 rules

arguments-ordering

Ensures that the order of named arguments in function, method, and constructor invocations matches the corresponding order of named parameters

#consistency#pedantic
⚙️🛠
avoid-accessing-collections-by-constant-index

Warns when a collection is accessed by a constant index inside a for loop

#correctness#collections
⚙️🛠
avoid-accessing-other-classes-private-members

Warns when a private member of another class is used

#correctness#maintainability#encapsulation
⚙️🛠
avoid-adjacent-strings

Warns against any usage of adjacent strings

#correctness#readability#maintainability
⚙️🛠
avoid-assigning-to-static-field

Warns when an instance method assigns to a static field

#correctness#maintainability#assignments
⚙️🛠
avoid-assignments-as-conditions

Warns when an assignment is used inside a condition

#correctness#readability#cwe#assignments
⚙️🛠
avoid-async-call-in-sync-function

Warns when an async function is invoked in non-async blocks

#correctness#maintainability#async
⚙️🛠
avoid-banned-annotations

Warns against using banned annotations (configurable)

#maintainability#requires-config
⚙️🛠
avoid-banned-file-names

Warns against using banned file names (configurable)

#architecture#maintainability#requires-config#naming
⚙️🛠
avoid-banned-imports

Warns against using banned imports (configurable)

#architecture#maintainability#requires-config#imports
⚙️🛠
avoid-banned-names

Warns against using banned names (configurable)

#readability#maintainability#requires-config#naming
⚙️🛠
avoid-banned-types

Warns against using banned types (configurable)

#architecture#maintainability#requires-config#types
⚙️🛠
avoid-barrel-files

Warns when a file is a barrel file

#maintainability#imports
⚙️🛠
avoid-bottom-type-in-patterns

Warns when a pattern contains a void,Never or Null type

#correctness#types
⚙️🛠
avoid-bottom-type-in-records

Warns when a record type declaration contains fields with void, Never or Null

#correctness#types
⚙️🛠
avoid-cascade-after-if-null

Warns when a cascade expression is used after if null (??) binary expression without parentheses

#correctness#control-flow
⚙️🛠
avoid-casting-to-extension-type

Warns when an expression is casted to an extension type

#correctness#cwe#types
⚙️🛠
avoid-collapsible-if

Warns when multiple nested if statements can be merged into one

#consistency#readability#control-flow
⚙️🛠
avoid-collection-equality-checks

Warns when a collection is checked for equality with another collection

#correctness#cwe#collections
⚙️🛠
avoid-collection-methods-with-unrelated-types

Warns when a collection method is used with an expression of an unrelated type

#correctness#cwe#types#collections
⚙️🛠
avoid-collection-mutating-methods

Warns when a mutating method is called on a collection

#correctness#maintainability#collections#encapsulation
⚙️🛠
avoid-commented-out-code

Warns when a section of code is commented out

#correctness#maintainability
⚙️🛠
avoid-complex-arithmetic-expressions

Warns when an arithmetic expression has too many terms

#readability#maintainability
⚙️🛠
avoid-complex-loop-conditions

Warns when a loop condition is too complex

#readability#maintainability#conditions
⚙️🛠
avoid-conditions-with-boolean-literals

Warns then a binary expression has a boolean constant that either makes the resulting value always the same or does not affect it

#correctness#unused-code#cwe#conditions
⚙️🛠
avoid-continue

Warns when the continue statement is used

#readability#maintainability#control-flow
⚙️🛠
avoid-contradictory-expressions

Warns when several conditions contradict each other

#correctness#cwe#conditions
⚙️🛠
avoid-declaring-call-method

Warns when a class has a call method

#maintainability
⚙️🛠
avoid-double-slash-imports

Warns when an import/export directive contains a double slash

#correctness#imports
⚙️🛠
avoid-duplicate-cascades

Warns when a cascade expression has duplicate cascades

#correctness#cwe
⚙️🛠
avoid-duplicate-collection-elements

Warns when a collection has duplicate collection elements

#correctness#cwe#collections
⚙️🛠
avoid-duplicate-constant-values

Warns when a class or enum declaration has several constants with the same primitive values

#correctness#cwe
⚙️🛠
avoid-duplicate-exports

Warns when a file has multiple exports declarations with the same URI

#correctness#cwe#imports
⚙️🛠
avoid-duplicate-initializers

Warns when a final variable has the same initializer as another variable in scope

#correctness#cwe#assignments
⚙️🛠
avoid-duplicate-map-keys

Warns when a map has duplicate keys

#correctness#cwe#assignments
⚙️🛠
avoid-duplicate-mixins

Warns when a class has a mixin that is already present in that class's hierarchy.

#correctness#cwe
⚙️🛠
avoid-duplicate-named-imports

Warns when a file has duplicate imports which differ only in name prefix

#maintainability#cwe#imports
⚙️🛠
avoid-duplicate-patterns

Warns when a LogicalOrPattern or LogicalAndPattern contains duplicate patterns

#correctness#unused-code#cwe#conditions
⚙️🛠
avoid-duplicate-switch-case-conditions

Warns when several switch cases have the same condition

#correctness#cwe#conditions
⚙️🛠
avoid-duplicate-test-assertions

Warns when a test case has multiple test assertions with the same expression and expected value

#correctness#cwe#testing
⚙️🛠
avoid-dynamic

Warns when the dynamic type is used as a variable type in a declaration, a function return type, etc.

#correctness#maintainability#types
⚙️🛠
avoid-empty-spread

Warns when a collection literal in spread (...[]) has no elements

#correctness#cwe#collections
⚙️🛠
avoid-empty-test-groups

Warns when a test group does not have any test cases

#correctness#cwe#testing
⚙️🛠
avoid-equal-expressions

Warns when both sides of a binary expression are the same

#correctness#unused-code#cwe#conditions
⚙️🛠
avoid-excessive-expressions

Warns when a condition has excessive expressions

#correctness#unused-code#cwe#conditions
⚙️🛠
avoid-explicit-pattern-field-name

Warns when an object pattern has an explicit field name

#consistency#readability
⚙️🛠
avoid-explicit-type-declaration

Warns when a variable is declared with an explicit type that can be omitted

#consistency#readability
⚙️🛠
avoid-extensions-on-records

Warns when an extension is declared on a record type

#maintainability#abstractions
⚙️🛠
avoid-function-type-in-records

Warns when a record type declaration contains a function type

#consistency#maintainability#abstractions
⚙️🛠
avoid-future-ignore

Warns when the result of any Future is ignored by calling .ignore()

#correctness#maintainability#async
⚙️🛠
avoid-future-tostring

Warns when a Future is a target of the toString method or is used in an interpolation

#correctness#cwe#async
⚙️🛠
avoid-generics-shadowing

Warns when a generic type shadows an existing top-level (class, mixin, typedef or enum) declaration

#correctness#types
⚙️🛠
avoid-getter-prefix

Warns when a getter name starts from a banned prefix (configurable)

#readability#requires-config#naming
⚙️🛠
avoid-global-state

Warns when a global mutable variables is used

#maintainability#cwe
⚙️🛠
avoid-high-cyclomatic-complexity

Warns when the cyclomatic complexity of a method or function exceeds the configured threshold

#readability#maintainability
⚙️🛠
avoid-identical-exception-handling-blocks

Warns when a try / catch has multiple catch blocks with the same body

#correctness#maintainability#error-handing
⚙️🛠
avoid-if-with-many-branches

Warns when an if statement has too many branches

#readability#maintainability#control-flow
⚙️🛠
avoid-ignoring-return-values

Warns when a return value of a method or function invocation or a class instance property access is not used

#correctness#maintainability
⚙️🛠
avoid-implicitly-nullable-extension-types

Warns when an extension type declaration does not have the implements clause

#correctness#maintainability#nullability
⚙️🛠
avoid-importing-entrypoint-exports

Warns when an entrypoint export is imported inside the library src folder

#maintainability#imports
⚙️🛠
avoid-incorrect-uri

Warns when the Uri constructor receives incorrect arguments

#correctness
⚙️🛠
avoid-inferrable-type-arguments

Warns when an inferrable type argument can be removed without affecting the code

#consistency#readability#types
⚙️🛠
avoid-inverted-boolean-checks

Warns when a condition has an inverted check

#readability#maintainability#conditions
⚙️🛠
avoid-keywords-in-wildcard-pattern

Warns when a wildcard pattern has declaration keywords

#readability
⚙️🛠
avoid-late-final-reassignment

Warns when a late final variable is assigned multiple times in the same block

#correctness#nullability
⚙️🛠
avoid-late-keyword

Warns when a field or variable is declared with a late keyword

#maintainability#nullability
⚙️🛠
avoid-local-functions

Warns when a function declaration is a local function

#readability#control-flow
⚙️🛠
avoid-long-functions

Warns when a function or method length (number of lines) exceeds the configured maximum

#readability#maintainability#cwe
⚙️🛠
avoid-long-files

Warns when a file length (number of lines) exceeds the configured maximum

#readability#maintainability
⚙️🛠
avoid-long-parameter-list

Warns then a parameter list has too many parameters

#readability#maintainability
⚙️🛠
avoid-long-records

Warns when a record has too many fields

#readability#maintainability
⚙️🛠
avoid-map-keys-contains

Warns when Map's .keys.contains is used instead of containsKey

#performance#collections
⚙️🛠
avoid-missed-calls

Warns when a method that should be invoked is passed as tear-off

#correctness
⚙️🛠
avoid-missing-completer-stack-trace

Warns when Completer.completeError is called without providing a stack trace

#correctness#error-handing
⚙️🛠
avoid-missing-enum-constant-in-map

Warns when a enum constant is missing in a map declaration

#correctness#assignments
⚙️🛠
avoid-missing-interpolation

Warns when a string equals to a variable name that is available in the current scope but is not wrapped into an interpolation

#correctness
⚙️🛠
avoid-missing-test-files

Configure a list of files that should have a corresponding test file

#maintainability#requires-config#testing
⚙️🛠
avoid-misused-test-matchers

Warns when an incorrect matcher or literal is used to verify the target expression

#correctness#testing
⚙️🛠
avoid-misused-set-literals

Warns when a set literal is used in a wrong place

#correctness
⚙️🛠
avoid-misused-wildcard-pattern

Warns when a wildcard pattern is used in the wrong context

#correctness#cwe#control-flow
⚙️🛠
avoid-mixing-named-and-positional-fields

Warns when a record declaration contains both named and positional fields

#consistency#readability
⚙️🛠
avoid-multi-assignment

Warns when multiple variable assignments are placed on the same line

#correctness#maintainability#cwe#assignments
⚙️🛠
avoid-mutating-parameters

Warns when a parameter's field or setter is reassigned.

#maintainability#assignments
⚙️🛠
avoid-negated-conditions

Warns when an if statement or conditional expression have a negated condition that can be inverted

#readability#maintainability#conditions
⚙️🛠
avoid-negations-in-equality-checks

Warns when an equality check has a negated expression

#correctness#readability#maintainability#conditions
⚙️🛠
avoid-nested-conditional-expressions

Suggests to refactor conditional expressions when the nesting level exceeds the configured threshold

#readability#conditions
⚙️🛠
avoid-nested-extension-types

Warns when the representation field of an extension type is also an extension type

#readability#types
⚙️🛠
avoid-nested-futures

Warns when a Future type contains another Future

#correctness#types
⚙️🛠
avoid-nested-records

Warns when a record type declaration contains a nested record type declaration

#readability#types
⚙️🛠
avoid-nested-streams-and-futures

Warns when a Stream type contains a Future or vice versa

#correctness#types
⚙️🛠
avoid-nested-switch-expressions

Warns when a switch expression contains another switch expression

#readability
⚙️🛠
avoid-nested-switches

Warns when a switch case body has another switch statement

#readability
⚙️🛠
avoid-nested-try-statements

Warns when a try statement contains another try statement

#readability#maintainability
⚙️🛠
avoid-non-ascii-symbols

Warns when a string literal contains non ascii characters

#correctness
⚙️🛠
avoid-non-empty-constructor-bodies

Suggests moving all initialization logic to a separate method instead of the constructor

#maintainability
⚙️🛠
avoid-non-final-exception-class-fields

Warns when an exception class declaration has non-final fields

#correctness#maintainability#error-handing
⚙️🛠
avoid-non-null-assertion

Warns when the non-null assertion operator ! (or “bang” operator) is used on a property access or method invocation

#correctness#cwe#nullability
⚙️🛠
avoid-not-encodable-in-to-json

Warns when a toJson method references a non-encodable object

#correctness#cwe
⚙️🛠
avoid-nullable-interpolation

Warns when an interpolation string contains a nullable value

#correctness
⚙️🛠
avoid-nullable-parameters-with-default-values

Warns when a parameter with the default value is marked as nullable

#correctness#maintainability#assignments
⚙️🛠
avoid-nullable-tostring

Warns when the toString method is called on a nullable value

#correctness#cwe#nullability
⚙️🛠
avoid-one-field-records

Warns when a record has only one field

#correctness
⚙️🛠
avoid-only-rethrow

Warns when a catch clause has only a rethrow expression

#correctness#cwe#error-handing
⚙️🛠
avoid-passing-async-when-sync-expected

Warns when an asynchronous function is used as an argument where a synchronous function is expected

#correctness#maintainability#cwe#async
⚙️🛠
avoid-passing-default-values

Warns when an invocation has an argument that matches the parameter's default value.

#readability#maintainability#assignments
⚙️🛠
avoid-passing-self-as-argument

Warns when an object is used as an argument to its own method

#correctness#cwe#assignments
⚙️🛠
avoid-positional-record-field-access

Warns when a record positional field is accessed via $

#readability#maintainability
⚙️🛠
avoid-recursive-calls

Warns when a function calls itself recursively

#correctness#maintainability
⚙️🛠
avoid-redundant-async

Checks for redundant async in a method or function body

#correctness#maintainability#async
⚙️🛠
avoid-redundant-else

Checks for else blocks that can be removed without changing semantics

#readability#control-flow
⚙️🛠
avoid-redundant-positional-field-name

Warns when a record positional field has a name

#correctness
⚙️🛠
avoid-redundant-pragma-inline

Warns when a @pragma('vm:prefer-inline') annotation has no effect

#correctness
⚙️🛠
avoid-referencing-discarded-variables

Warns when a variable with the name that has only underscores (ex. _, __, etc.) is referenced

#correctness#maintainability
⚙️🛠
avoid-referencing-subclasses

Warns when a parent class references its child class

#correctness#maintainability#cwe#abstractions
⚙️🛠
avoid-renaming-representation-getters

Warns when an extension type exposes a member that renames an existing representation field member

#correctness#naming
⚙️🛠
avoid-returning-cascades

Warns when a cascade expression is being returned from a function

#readability#maintainability#control-flow
⚙️🛠
avoid-returning-void

Suggests calling functions or methods with a void return type separately from the return statement

#readability#maintainability
⚙️🛠
avoid-self-assignment

Warns when a variable or a class instance field / property is assigned to itself

#correctness#assignments
⚙️🛠
avoid-self-compare

Warns when a comparison has both sides exactly the same

#correctness#cwe#conditions
⚙️🛠
avoid-shadowed-extension-methods

Warns when an extension declares a method with the name that is already used by the extension target

#correctness
⚙️🛠
avoid-shadowing

Warns when a declaration name shadows another declaration with the same name in the current scope

#correctness
⚙️🛠
avoid-similar-names

Checks for names within the scope that are very similar and thus confusing

#readability#maintainability
⚙️🛠
avoid-single-field-destructuring

Suggests using a regular variable declaration instead of a single field destructuring

#consistency#readability
⚙️🛠
avoid-slow-collection-methods

Warns when an invocation is a slow sync* invocation

#performance#collections
⚙️🛠
avoid-substring

Warns when a String.substring method is used

#correctness
⚙️🛠
avoid-suspicious-super-overrides

Warns when a getter overrides a field that is already passed to the super constructor

#correctness
⚙️🛠
avoid-throw-in-catch-block

Warns when a throw expression is called inside a catch block

#correctness#error-handing
⚙️🛠
avoid-throw-objects-without-tostring

Warns when a thrown object does not implement toString

#correctness#cwe#error-handing
⚙️🛠
avoid-top-level-members-in-tests

Warns when a public top-level member (except the entrypoint) is declared inside a test file

#maintainability#testing
⚙️🛠
avoid-type-casts

Warns about any usage of the as operator

#correctness#maintainability#cwe#types
⚙️🛠
avoid-unassigned-late-fields

Warns when a late field is not assigned a value

#correctness#cwe#assignments
⚙️🛠
avoid-unassigned-stream-subscriptions

Warns when a stream subscription is not assigned to a variable

#memory-leak#cwe#assignments
⚙️🛠
avoid-uncaught-future-errors

Warns when an error from a Future inside a try / catch block might not be caught

#correctness#error-handing#async
⚙️🛠
avoid-unconditional-break

Warns when a break, continue, return or throw are used unconditionally in a for loop

#correctness#cwe#control-flow
⚙️🛠
avoid-unknown-pragma

Warns when the @pragma annotation has an unknown value

#correctness
⚙️🛠
avoid-unnecessary-block

Suggests removing unnecessary blocks

#readability#maintainability
⚙️🛠
avoid-unnecessary-call

Warns when a .call() invocation is unnecessary and can be simplified

#readability
⚙️🛠
avoid-unnecessary-collections

Warns when a collection literal can be replaced by its first and only element

#correctness#collections
⚙️🛠
avoid-unnecessary-conditionals

Checks for unnecessary conditional expressions

#consistency#readability#conditions#control-flow
⚙️🛠
avoid-unnecessary-constructor

Suggests removing an unnecessary empty constructor for enum and class declarations

#consistency#readability
⚙️🛠
avoid-unnecessary-continue

Warns when a continue statement is unnecessary and can be removed

#readability#control-flow
⚙️🛠
avoid-unnecessary-enum-arguments

Warns when a enum constant has an unnecessary empty argument list

#consistency#readability
⚙️🛠
avoid-unnecessary-enum-prefix

Suggests removing unnecessary enum prefixes

#consistency#readability
⚙️🛠
avoid-unnecessary-extends

Suggests removing unnecessary extends clauses that match default values for classes and type parameters

#consistency
⚙️🛠
avoid-unnecessary-futures

Warns when a return type of a declaration is unnecessary wrapped into a Future

#maintainability#async
⚙️🛠
avoid-unnecessary-getter

Warns when a getter provides access to an existing final field without any additional logic

#consistency
⚙️🛠
avoid-unnecessary-if

Warns when a return statement inside an if block is equal to the return statement after it

#correctness#control-flow
⚙️🛠
avoid-unnecessary-local-late

Warns when a late variable is assigned in all code branches before use

#maintainability#nullability#assignments
⚙️🛠
avoid-unnecessary-negations

Warns when a negation can be simplified

#readability#maintainability#conditions
⚙️🛠
avoid-unnecessary-nullable-return-type

Warns when the return type of a function or a method is declared nullable, but the function or method always return non-nullable value

#correctness#maintainability#nullability
⚙️🛠
avoid-unnecessary-overrides

Warns when a parent declaration is overridden by a declaration without an implementation

#correctness#maintainability
⚙️🛠
avoid-unnecessary-patterns

Warns when a pattern variable declaration does not affect the type of an existing local variable

#correctness#unused-code#cwe
⚙️🛠
avoid-unnecessary-reassignment

Warns when a value is reassigned to a variable without using the initial value

#correctness#maintainability#cwe#assignments
⚙️🛠
avoid-unnecessary-return

Warns when a return statement is unnecessary and can be removed

#readability#control-flow
⚙️🛠
avoid-unnecessary-super

Warns when a constructor has an unnecessary super invocation or when an invocation has an unnecessary super prefix

#consistency
⚙️🛠
avoid-unnecessary-type-assertions

Warns about unnecessary usage of the is operator, and whereType and whereNotNull methods

#correctness#unused-code#cwe#types
⚙️🛠
avoid-unnecessary-type-casts

Warns about unnecessary use of the as operator and cast method

#correctness#unused-code#cwe#types
⚙️🛠
avoid-unrelated-type-assertions

Warns about unrelated usages of the is operator and whereType method

#correctness#cwe#types
⚙️🛠
avoid-unrelated-type-casts

Warns about unrelated usages of the as operator and cast method

#correctness#cwe#types
⚙️🛠
avoid-unsafe-collection-methods

Warns when first, last, single, firstWhere, lastWhere, singleWhere or [] methods are used on Iterable or its subclasses

#correctness#maintainability#cwe#collections
⚙️🛠
avoid-unsafe-reduce

Warns when the .reduce collection method is called on a potentially empty collection

#correctness#maintainability#cwe#collections
⚙️🛠
avoid-unused-after-null-check

Warns when a variable is checked for non-nullable value, but is not used within the condition or then branch

#correctness#control-flow
⚙️🛠
avoid-unused-assignment

Warns when an assignment is not used in the subsequent statements

#correctness#unused-code#cwe#assignments
⚙️🛠
avoid-unused-generics

Warns when a function or method declares unused generic types

#correctness#unused-code#cwe
⚙️🛠
avoid-unused-instances

Warns when a newly created object is not being used

#correctness
⚙️🛠
avoid-unused-parameters

Checks for unused parameters inside a function or method body

#correctness#unused-code#cwe
⚙️🛠
avoid-weak-cryptographic-algorithms

Warns when a weak cryptographic algorithm (ex. md5 or sha1) is used

#security#cwe
⚙️🛠
avoid-wildcard-cases-with-enums

Warns when a switch on the Enum value has a wildcard pattern case

#correctness#maintainability
⚙️🛠
banned-usage

Warns when the configured method, field, constructor, or property name is used

#architecture#consistency#maintainability#requires-config
⚙️🛠
binary-expression-operand-order

Warns when a literal value is on the left hand side in a binary expressions

#consistency#readability#conditions
⚙️🛠
dispose-class-fields

Warns when a field is not disposed in a class's dispose method

#correctness#memory-leak
⚙️🛠
double-literal-format

Checks that double literals should begin with 0. instead of just ., and should not end with a trailing 0

#consistency#readability
⚙️🛠
enum-constants-ordering

Ensures consistent alphabetical order of Enum constants

#consistency
⚙️🛠
format-comment

Suggests to format comments like sentences

#consistency#readability
⚙️🛠
format-test-name

Warns when a test or testWidgets name doesn't follow the configured pattern

#consistency#readability#requires-config#testing
⚙️🛠
function-always-returns-null

Warns when a function with nullable return type returns only nullvalue

#correctness#cwe#control-flow
⚙️🛠
function-always-returns-same-value

Warns when a function always returns the same constant value

#correctness#cwe#control-flow
⚙️🛠
handle-throwing-invocations

Warns when an invocation's declaration is annotated with @Throws() but the potential exception is not handled

#correctness#maintainability#cwe#error-handing
⚙️🛠
map-keys-ordering

Ensures consistent alphabetical order of String keys inside a map

#consistency#readability#pedantic
⚙️🛠
match-class-name-pattern

Warns when a class name does not match the configured pattern

#consistency#readability#requires-config#naming
⚙️🛠
match-getter-setter-field-names

Warns when a getter or setter do not access at least one field with the name that matches the getter or setter name

#correctness#readability#maintainability#naming
⚙️🛠
match-lib-folder-structure

Warns when the file path in the test folder does not match the implementation file path in the lib folder

#consistency#maintainability
⚙️🛠
match-positional-field-names-on-assignment

Warns when a positional field name does not match a variable name on destructuring assignment

#correctness#consistency#assignments
⚙️🛠
member-ordering

Enforces ordering for a class members

#consistency#pedantic
⚙️🛠
missing-test-assertion

Warns when there are no test assertions in a test case

#correctness#testing
⚙️🛠
missing-use-result-annotation

Warns when a method or function declaration is missing the @useResult annotation

#correctness#maintainability#requires-config#control-flow
⚙️🛠
move-records-to-typedefs

Warns when a record type should be moved to a typedef

#consistency#readability
⚙️🛠
move-variable-closer-to-its-usage

Warns when a variable is declared in the outer block, but used only in the inner one

#readability#maintainability#control-flow
⚙️🛠
move-variable-outside-iteration

Warns when a variable does not depend on the outer loop and can be moved out

#correctness#readability#maintainability#control-flow
⚙️🛠
newline-before-case

Enforces a blank line between cases in a switch statement

#consistency#readability
⚙️🛠
newline-before-method

Enforces a blank line before a method declaration

#consistency#readability
⚙️🛠
newline-before-return

Enforces a blank line between statements and return in a block

#consistency#readability
⚙️🛠
no-boolean-literal-compare

Warns on comparison to a boolean literal, as in x == true

#readability#conditions
⚙️🛠
no-empty-block

Disallows empty blocks except catch clause block

#correctness#cwe
⚙️🛠
no-empty-string

Warns when a string literal is empty

#correctness#maintainability#assignments
⚙️🛠
no-equal-arguments

Warns when equal arguments are passed to a function or method invocation

#correctness#maintainability#cwe
⚙️🛠
no-equal-conditions

Warns when a if statement has duplicate conditions

#correctness#unused-code#cwe#conditions
⚙️🛠
no-equal-nested-conditions

Warns when an if statement contains another if statement with the same condition

#correctness#cwe#conditions
⚙️🛠
no-equal-switch-case

Warns when a switch has cases with equal bodies

#correctness#maintainability#cwe#control-flow
⚙️🛠
no-equal-switch-expression-cases

Warns when a switch expression has cases with equal bodies

#correctness#maintainability#cwe#control-flow
⚙️🛠
no-equal-then-else

Warns when if statement has equal then and else statements or conditional expression has equal then and else expressions

#correctness#cwe#control-flow
⚙️🛠
no-magic-number

Warns when number literals are used outside of named constants or variables

#readability#maintainability
⚙️🛠
no-magic-string

Warns when string literals are used outside of named constants or variables

#readability#maintainability
⚙️🛠
no-object-declaration

Warns when a class member is declared with Object type

#maintainability#abstractions
⚙️🛠
parameters-ordering

Ensures consistent alphabetical order of parameters by their names

#consistency#readability#pedantic
⚙️🛠
pattern-fields-ordering

Ensures consistent alphabetical order of pattern fields by their names

#consistency#readability#pedantic
⚙️🛠
prefer-abstract-final-static-class

Suggests adding abstract final to classes with only static members to avoid them being instantiated or being used in inheritance

#readability#maintainability
⚙️🛠
prefer-add-all

Suggests using .addAll() instead of multiple .add() invocations

#consistency#readability#collections
⚙️🛠
prefer-addition-subtraction-assignments

Warns when ++ or -- is used instead of += or -=

#correctness#assignments
⚙️🛠
prefer-any-or-every

Warns when a collection's call chain can be rewritten to use .any() or .every() instead of .isEmpty or .isNotEmpty

#readability#collections
⚙️🛠
prefer-assigning-await-expressions

Suggests moving await expressions to dedicated local variables

#readability#maintainability#assignments#async
⚙️🛠
prefer-async-await

Recommends to use async/await syntax to handle a Future result instead of .then() invocation

#readability#maintainability#async
⚙️🛠
prefer-boolean-prefixes

Suggests to prefix boolean variables, methods, fields and parameters with one of the configured prefixes

#readability#naming
⚙️🛠
prefer-both-inlining-annotations

Warns when a @pragma('vm:prefer-inline') annotation does not have a corresponding @pragma('dart2js:tryInline') annotation

#correctness
⚙️🛠
prefer-bytes-builder

Warns when an expensive byte list operation is used

#performance
⚙️🛠
prefer-class-destructuring

Warns when several different property accesses can be replaced by a single class destructuring declaration

#consistency#maintainability#assignments
⚙️🛠
prefer-commenting-analyzer-ignores

Warns when // ignore: comments are left without any additional description of why this ignore is applied

#maintainability
⚙️🛠
prefer-commenting-future-delayed

Warns when Future.delayed invocations do not have a descriptive comment

#maintainability#async
⚙️🛠
prefer-conditional-expressions

Recommends to use a conditional expression instead of assigning to the same thing or return statement in each branch of an if statement

#readability#conditions
⚙️🛠
prefer-contains

Suggests using .contains instead of .indexOf when checking for the presence of an element

#readability#collections
⚙️🛠
prefer-correct-callback-field-name

Warns when a field with a Function type does not matched the configured name or a field with a non-Function type matches the configured name

#consistency#readability#naming
⚙️🛠
prefer-correct-error-name

Ensures a consistent name for the error parameter in catch, then, catchError, listen and handleError

#consistency#readability#naming#error-handing
⚙️🛠
prefer-correct-for-loop-increment

Warns when a for loop increments a wrong variable

#correctness#cwe#assignments
⚙️🛠
prefer-correct-future-return-type

Warns when a declaration that returns a Future has an incorrect return type

#maintainability#types#async
⚙️🛠
prefer-correct-handler-name

Warns when the callback handler name does not matched the configured one

#consistency#naming
⚙️🛠
prefer-correct-identifier-length

Warns when the identifier name in variables, parameters, or enum constants is too short or too long

#consistency#readability#naming
⚙️🛠
prefer-correct-json-casts

Warns when a JSON object type cast is done in an unsafe way that will throw at runtime

#correctness#maintainability#cwe#types
⚙️🛠
prefer-correct-setter-parameter-name

Warns when the setter parameter name does not match the configured one

#consistency#naming
⚙️🛠
prefer-correct-stream-return-type

Warns when a declaration that returns a Stream has an incorrect return type

#maintainability#types
⚙️🛠
prefer-correct-switch-length

Warns when a switch has too few or too many cases

#readability#maintainability#control-flow
⚙️🛠
prefer-correct-test-file-name

Warns if the file within /test contains a main, but the file name doesn't end with _test.dart

#correctness#testing#naming
⚙️🛠
prefer-correct-throws

Warns when a declaration is missing or has an unnecessary @Throws() annotation

#correctness#maintainability#error-handing
⚙️🛠
prefer-correct-type-name

Warns when a type name contains unexpected characters, does not start with an uppercase character, or is too short or too long

#consistency#readability#naming
⚙️🛠
prefer-declaring-const-constructor

Warns when a class with no non-final fields has a non-constant constructor declaration

#consistency#performance
⚙️🛠
prefer-early-return

Warns when an if statement can be transformed to an early return

#readability#control-flow
⚙️🛠
prefer-enums-by-name

Since Dart 2.15 it's possible to use byName method on enum values prop instead of searching the value with firstWhere

#readability
⚙️🛠
prefer-expect-later

Warns when a Future is passed to expect without it being awaited

#correctness#testing
⚙️🛠
prefer-explicit-function-type

Warns when a Function type does not specify the return type and arguments

#correctness#consistency#maintainability
⚙️🛠
prefer-explicit-parameter-names

Warns when parameter names in function types are omitted

#consistency#readability#naming
⚙️🛠
prefer-explicit-type-arguments

Warns when a method that accepts type arguments has no arguments and no type arguments passed

#correctness#maintainability
⚙️🛠
prefer-extracting-function-callbacks

Warns when an inline callback is passed as an argument to a function or method invocation

#readability#maintainability
⚙️🛠
prefer-first

Suggests using first instead of list[0] or iterable.elementAt(0)

#consistency#readability#collections
⚙️🛠
prefer-for-in

Suggests using for-in loop instead of the regular loop

#consistency#readability#collections
⚙️🛠
prefer-getter-over-method

Suggests to convert a method that has no parameters and side-effects to a getter

#readability
⚙️🛠
prefer-immediate-return

Warns when a method or a function returns a variable declared right before the return statement

#readability#control-flow
⚙️🛠
prefer-iterable-of

Warns when List.from() factory is used instead of List.of()

#correctness#cwe#collections
⚙️🛠
prefer-last

Suggests using last instead of list[list.length - 1] or iterable.elementAt(iterable.length - 1)

#consistency#readability#collections
⚙️🛠
prefer-match-file-name

Warns when a file name does not match the class name

#consistency#readability#maintainability#naming
⚙️🛠
prefer-moving-to-variable

Warns when a property access or a method invocation start with duplicated chains of other invocations / accesses inside a single function or method block

#maintainability
⚙️🛠
prefer-named-boolean-parameters

Warns when a declaration has a boolean positional parameter

#readability#maintainability
⚙️🛠
prefer-named-imports

Warns if the configured import is not a named import

#consistency#readability#maintainability#requires-config#imports
⚙️🛠
prefer-named-parameters

Suggests converting positional parameters to named parameters when a declaration has a certain number of positional parameters

#readability#maintainability
⚙️🛠
prefer-null-aware-spread

Warns when a null check inside a collection literal can be replaced with a null-aware spread (...?)

#readability#collections#nullability
⚙️🛠
prefer-overriding-parent-equality

Warns when a parent class implements hashCode and ==, but the child class does not implement them

#correctness
⚙️🛠
prefer-parentheses-with-if-null

Warns when an if null (??) has a binary expression without parentheses

#correctness#control-flow
⚙️🛠
prefer-prefixed-global-constants

Warns when a global constant does not start with a configured prefix

#consistency#readability#naming
⚙️🛠
prefer-private-extension-type-field

Warns when an extension type has a public representation field

#maintainability#encapsulation
⚙️🛠
prefer-public-exception-classes

Warns when an exception class declaration is not public

#correctness#maintainability#error-handing
⚙️🛠
prefer-redirecting-superclass-constructor

Suggests using a redirecting constructor declared in the superclass

#consistency#readability
⚙️🛠
prefer-return-await

Warns when a Future is returned from a try / catch block without an await

#correctness#cwe#async
⚙️🛠
prefer-returning-conditional-expressions

Warns when several returns inside a function body can be replace with a single conditional expression

#readability#conditions
⚙️🛠
prefer-simpler-boolean-expressions

Suggests simplifying various boolean expressions

#readability#maintainability#conditions
⚙️🛠
prefer-simpler-patterns-null-check

Warns when a patterns check for non-nullability can be simplified

#readability#maintainability#nullability
⚙️🛠
prefer-single-declaration-per-file

Warns when a file contains more than one top-level declaration (class, mixin, extension, enum or extension type)

#readability#maintainability
⚙️🛠
prefer-specific-cases-first

Warns when a more specific switch case is placed after a more general one

#correctness#cwe#control-flow
⚙️🛠
prefer-static-class

Suggests to use static class member instead of global constants, variables and functions

#consistency
⚙️🛠
prefer-static-method

Suggests converting an instance method to a static method if it does not reference any instance or inherited members

#consistency#maintainability
⚙️🛠
prefer-switch-expression

Suggests converting switch statements to switch expressions

#consistency#readability#control-flow
⚙️🛠
prefer-switch-with-enums

Suggests to use a switch statement or expression instead of conditionals with multiple enum values

#readability#maintainability#control-flow
⚙️🛠
prefer-switch-with-sealed-classes

Suggests to use a switch statement or expression instead of conditionals with sealed class instances

#readability#maintainability#control-flow
⚙️🛠
prefer-test-matchers

Warns when the second argument of an expect or expectLater is not a subclass of a Matcher

#consistency#maintainability#testing
⚙️🛠
prefer-trailing-comma

Checks for a trailing comma for arguments, parameters, enum values and collections

#consistency#readability
⚙️🛠
prefer-type-over-var

Warns when a variable is declared with the var keyword instead of a type

#readability#maintainability
⚙️🛠
prefer-typedefs-for-callbacks

Warns when a Function type is declared not as a typedef

#readability#maintainability
⚙️🛠
prefer-unique-test-names

Warns when the test name is not unique within the same test suite

#correctness#testing#naming
⚙️🛠
prefer-unwrapping-future-or

Warns when a FutureOr is not unwrapped before being used

#maintainability#async
⚙️🛠
prefer-visible-for-testing-on-members

Warns when the @visibleForTesting annotation is applied to the class declaration

#correctness#testing
⚙️🛠
prefer-wildcard-pattern

Warns when a dynamic or Object type is used instead of a wildcard pattern

#consistency#readability
⚙️🛠
record-fields-ordering

Ensured consistent alphabetical order of named record fields

#consistency#maintainability#pedantic
⚙️🛠
tag-name

Warns when a tag name does not match the class name

#correctness#requires-config
⚙️🛠
unnecessary-trailing-comma

Checks for unnecessary trailing commas for arguments, parameters, enum values and collections

#consistency#readability
⚙️🛠
use-existing-destructuring

Warns when there is an existing class or record destructuring that can be used instead of accessing the property directly

#consistency#maintainability#assignments
⚙️🛠
use-existing-variable

Warns when an expression can be replaced by an existing variable with the same initializer

#consistency#maintainability#assignments
⚙️🛠

Flutter 49 rules

add-copy-with

Warns when a class that matches the config does not declare a copyWith method

#correctness#maintainability#requires-config
⚙️🛠
always-remove-listener

Warns when an event listener is added but never removed

#correctness#memory-leak
⚙️🛠
avoid-border-all

Suggests replacing the Border.all constructor with the const Border.fromBorderSide constructor

#readability#performance
⚙️🛠
avoid-empty-setstate

Warns when a setState callback is empty

#correctness#cwe
⚙️🛠
avoid-expanded-as-spacer

Suggests using the Spacer widget instead of the Expanded widget containing empty SizedBox/Container widget

#consistency#readability
⚙️🛠
avoid-flexible-outside-flex

Warns when a Flexible widget is used outside the Flex widget

#correctness
⚙️🛠
avoid-incomplete-copy-with

Checks if all parameters from the default constructor are added to the copyWith method

#correctness#maintainability
⚙️🛠
avoid-incorrect-image-opacity

Warns when an Image widget is wrapped into an Opacity widget

#performance
⚙️🛠
avoid-inherited-widget-in-initstate

Warns when context.dependOnInheritedWidgetOfExactType is transitively called from any invocation in initState

#correctness
⚙️🛠
avoid-late-context

Warns when the context is used inside a late field initializer

#correctness
⚙️🛠
avoid-missing-controller

Warns when a TextFormField, TextField or EditableText does not have at least one way to get the updated value

#correctness
⚙️🛠
avoid-missing-image-alt

Warns when an Image widget does not have a semanticLabel

#accessibility
⚙️🛠
avoid-recursive-widget-calls

Warns when a Widget recursively uses itself

#correctness
⚙️🛠
avoid-returning-widgets

Warns when a method or function returns a Widget or subclass of a Widget

#correctness#maintainability#performance
⚙️🛠
avoid-shrink-wrap-in-lists

Warns when a ListView widget with shrinkWrap parameter is wrapped in a Column, Row or another ListView widget

#correctness
⚙️🛠
avoid-single-child-column-or-row

Warns when a Column, Row, Flex, Wrap, SliverList, SliverMainAxisGroup or SliverCrossAxisGroup widget has only one child

#correctness#maintainability
⚙️🛠
avoid-state-constructors

Warns when a State has a constructor with non-empty body

#correctness
⚙️🛠
avoid-undisposed-instances

Warns when an instance that has a dispose method is not assigned to a variable

#correctness#memory-leak
⚙️🛠
avoid-unnecessary-gesture-detector

Warns when a GestureDetector widget has no event handlers

#correctness#maintainability#unused-code
⚙️🛠
avoid-stateless-widget-initialized-fields

Warns when a StatelessWidget has an initialized final field

#correctness
⚙️🛠
avoid-unnecessary-overrides-in-state

Warns when a widget's State has unnecessary overrides

#correctness#maintainability
⚙️🛠
avoid-unnecessary-setstate

Warns when setState is called inside initState, didUpdateWidget or build methods and when it is called from a sync method that is called inside those methods

#correctness#performance
⚙️🛠
avoid-unnecessary-stateful-widgets

Warns when a StatefulWidget can be converted to a StatelessWidget

#readability#maintainability
⚙️🛠
avoid-wrapping-in-padding

Warns when a widget is wrapped in a Padding widget but has a padding setting by itself

#correctness
⚙️🛠
check-for-equals-in-render-object-setters

Warns when a RenderObject setter doesn't have an equality check for the new value

#correctness
⚙️🛠
consistent-update-render-object

Warns when an updateRenderObject method is absent or doesn't update all fields set in createRenderObject

#correctness
⚙️🛠
dispose-fields

Warns when a widget state field is not disposed in dispose method

#correctness#memory-leak
⚙️🛠
prefer-action-button-tooltip

Warns when a FloatingActionButton does not have a tooltip specified

#correctness
⚙️🛠
prefer-align-over-container

Suggests using the Align widget instead of the Container widget with only the alignment argument

#consistency#readability
⚙️🛠
prefer-center-over-align

Suggests using the Center widget instead of the Align widget with no passed arguments

#consistency#readability
⚙️🛠
prefer-const-border-radius

Suggests replacing the BorderRadius.circular constructor with the const BorderRadius.all constructor

#performance
⚙️🛠
prefer-container

Suggests replacing a sequence of widgets with a single Container widget

#consistency#readability
⚙️🛠
prefer-correct-edge-insets-constructor

Suggests using the correct EdgeInsets constructor

#consistency#readability
⚙️🛠
prefer-dedicated-media-query-methods

Warns when MediaQuery.of or MediaQuery.maybeOf are used over dedicated methods (ex. sizeOf)

#correctness#performance
⚙️🛠
prefer-define-hero-tag

Warns when a Widget has an unset heroTag

#correctness
⚙️🛠
prefer-extracting-callbacks

Warns about inline callbacks in a widget tree and suggest to extract them to a widget method

#readability#maintainability
⚙️🛠
prefer-for-loop-in-children

Suggests using for-loop in arguments that accept a list of widgets

#readability#maintainability
⚙️🛠
prefer-padding-over-container

Suggests using the Padding widget instead of the Container widget with only padding or margin arguments

#consistency#readability
⚙️🛠
prefer-single-widget-per-file

Warns when a file contains more than one widget

#readability#maintainability
⚙️🛠
prefer-sized-box-square

Suggests using the SizedBox.square constructor when height and width arguments have the same value

#readability
⚙️🛠
prefer-sliver-prefix

Warns when a widget that returns a Sliver... widget does not have a Sliver prefix in its name

#readability#maintainability
⚙️🛠
prefer-spacing

Suggests using the spacing argument of a Row, Column or Flex instead of using SizedBox widgets for adding gaps between children widgets

#readability#maintainability
⚙️🛠
prefer-text-rich

Warns when a RichText widget is used instead of Text.rich

#accessibility
⚙️🛠
prefer-transform-over-container

Suggests using the Transform widget instead of the Container widget with only the transform argument

#consistency#readability
⚙️🛠
prefer-using-list-view

Warns when a Column widget with only children parameter is wrapped in a SingleChildScrollView widget

#correctness
⚙️🛠
prefer-widget-private-members

Warns when a widget or widget state have public members (fields, methods, etc.)

#maintainability
⚙️🛠
proper-super-calls

Checks that super calls in the initState and dispose methods are called in the correct order

#correctness
⚙️🛠
use-closest-build-context

Warns when the referenced BuildContext variable is not the closest BuildContext

#correctness
⚙️🛠
use-setstate-synchronously

Warns when setState is called past an await point

#correctness
⚙️🛠

Provider 6 rules

note
Lint rules for the Provider package.
avoid-instantiating-in-value-provider

Warns when a Provider.value returns a new instance instead of reusing an existing one

#correctness
⚙️🛠
avoid-read-inside-build

Warns when a read method is used inside the build method

#correctness
⚙️🛠
avoid-watch-outside-build

Warns when a watch or select methods are used outside of the build method

#correctness
⚙️🛠
dispose-providers

Warns when a provided class with a dispose method does not have this method called in the Provider dispose callback

#correctness#memory-leak
⚙️🛠
prefer-multi-provider

Warns when multiple nested Providers can be replaced with MultiProvider instead

#readability#maintainability
⚙️🛠
prefer-provider-extensions

Suggests using context.read() or context.watch() instead of Provider.of(context)

#readability#maintainability
⚙️🛠

Bloc 22 rules

note
Lint rules for the Bloc package.
avoid-bloc-public-fields

Warns when a Bloc or Cubit has public fields

#correctness#maintainability#encapsulation
⚙️🛠
avoid-bloc-public-methods

Warns when a Bloc has public methods except the overridden ones

#correctness#maintainability#encapsulation
⚙️🛠
avoid-cubits

Warns when a Cubit is used

#maintainability
⚙️🛠
avoid-duplicate-bloc-event-handlers

Warns when a bloc declares multiple event handlers for the same event

#correctness#maintainability
⚙️🛠
avoid-empty-build-when

Warns when a BlocBuilder or BlocConsumer does not specify the buildWhen condition

#performance#maintainability
⚙️🛠
avoid-existing-instances-in-bloc-provider

Warns when a BlocProvider returns an existing instance instead of creating a new one

#correctness
⚙️🛠
avoid-instantiating-in-bloc-value-provider

Warns when a BlocProvider.value returns a new instance instead of reusing an existing one

#correctness
⚙️🛠
avoid-passing-bloc-to-bloc

Warns when a Bloc depends on another Bloc

#correctness#maintainability#encapsulation
⚙️🛠
avoid-passing-build-context-to-blocs

Warns when a Bloc event or a Cubit method accept BuildContext

#correctness#maintainability#encapsulation
⚙️🛠
avoid-returning-value-from-cubit-methods

Warns when a Cubit method returns a value

#correctness#maintainability
⚙️🛠
check-is-not-closed-after-async-gap

Warns when an async handler does not have isClosed check before dispatching an event after an async gap

#correctness#maintainability
⚙️🛠
emit-new-bloc-state-instances

Warns when an emit invocation receives the existing state instead of a newly created instance

#correctness
⚙️🛠
handle-bloc-event-subclasses

Warns when a bloc does not handle all event subclasses

#correctness
⚙️🛠
prefer-bloc-event-suffix

Warns when a Bloc event class name does not match the configured pattern

#readability#maintainability
⚙️🛠
prefer-bloc-extensions

Suggests using context.read() or context.watch() instead of BlocProvider.of(context)

#readability#maintainability
⚙️🛠
prefer-bloc-state-suffix

Warns when a Bloc state class name does not match the configured pattern

#readability#maintainability
⚙️🛠
prefer-correct-bloc-provider

Warns when a Bloc is provided not with a BlocProvider

#correctness
⚙️🛠
prefer-immutable-bloc-events

Warns when a Bloc event does not have the @immutable annotation

#maintainability
⚙️🛠
prefer-immutable-bloc-state

Warns when a Bloc state does not have the @immutable annotation

#maintainability
⚙️🛠
prefer-multi-bloc-provider

Warns when a BlocProvider / BlocListener / RepositoryProvider can be replace with a Multi version

#readability#maintainability
⚙️🛠
prefer-sealed-bloc-events

Warns when Bloc events do not have a sealed or final modifier

#readability#maintainability
⚙️🛠
prefer-sealed-bloc-state

Warns when Bloc state classes do not have a sealed or final modifier

#readability#maintainability
⚙️🛠

Riverpod 7 rules

note
Lint rules for the Riverpod package.
avoid-calling-notifier-members-inside-build

Warns when a Notifier (or AsyncNotifier) member is called inside the build method

#correctness
⚙️🛠
avoid-notifier-constructors

Warns when a Notifier (or AsyncNotifier) has a non-empty constructor

#correctness
⚙️🛠
avoid-ref-read-inside-build

Warns when ref.read is used inside the build method

#correctness
⚙️🛠
avoid-ref-watch-outside-build

Warns when ref.watch is used outside of the build method

#correctness
⚙️🛠
avoid-unnecessary-consumer-widgets

Warns when a ConsumerWidget has an unused ref and can be converted to a regular widget

#correctness#consistency#maintainability
⚙️🛠
dispose-provided-instances

Warns when an instance with a dispose method created inside a provider does not have the dispose method called in ref.onDispose

#correctness#memory-leak
⚙️🛠
use-ref-read-synchronously

Warns when ref.read is called past an await point

#correctness
⚙️🛠

Equatable 2 rules

note
Lint rules for the Equatable package.
extend-equatable

Warns when a class that matches the config does not extend Equatable

#correctness#requires-config
⚙️🛠
list-all-equatable-fields

Warns when a field is not added to props getter of a class that extends Equatable or EquatableMixin

#correctness
⚙️🛠

Flame 4 rules

note
Lint rules for the Flame package.
avoid-creating-vector-in-update

Warns when a Vector2 is created inside a Component's update method

#correctness
⚙️🛠
avoid-initializing-in-on-mount

Warns when a late final variable is being initialized in the Component's onMount method

#correctness
⚙️🛠
avoid-redundant-async-on-load

Warns when a Component's onLoad method can be made sync

#correctness
⚙️🛠
correct-game-instantiating

Warns when a game is instantiated in a StatelessWidget build method

#correctness
⚙️🛠

Patrol 2 rules

note
Lint rules for the Patrol package.
prefer-custom-finder-over-find

Suggests using custom finders instead of find in Patrol tests

#consistency#readability#testing
⚙️🛠
prefer-symbol-over-key

Suggests using symbols instead of string keys in Patrol tests

#consistency#readability#testing
⚙️🛠

Fake Async 1 rule

note
Lint rules for the Fake Async package.
avoid-async-callback-in-fake-async

Warns when an async callback is passed to FakeAsync

#correctness#async
⚙️🛠

Get It 1 rule

note
Lint rules for the Get It package.
avoid-functions-in-register-singleton

Warns when a function is passed to registerSingleton

#correctness
⚙️🛠

Flutter Hooks 6 rules

note
avoid-conditional-hooks

Warns when hooks inside the build method or other hooks are called conditionally

#correctness
⚙️🛠
avoid-hooks-outside-build

Warns when a hook is used outside the build method, other hooks or HookBuilder

#correctness
⚙️🛠
avoid-misused-hooks

Warns when hooks are used in non-hook widgets

#correctness
⚙️🛠
avoid-unnecessary-hook-widgets

Warns when a hook widget or HookBuilder does not use hooks

#correctness#maintainability
⚙️🛠
prefer-use-callback

Suggests using useCallback instead of useMemoized when applicable

#consistency#readability
⚙️🛠
prefer-use-prefix

Suggests renaming hooks to start with use

#consistency#readability#maintainability
⚙️🛠

Firebase Analytics 2 rules

note
incorrect-firebase-event-name

Warns when the event name does not comply with Firebase limitations

#correctness
⚙️🛠
incorrect-firebase-parameter-name

Warns when the parameter name does not comply with Firebase limitations

#correctness
⚙️🛠

GetX 5 rules

note
Lint rules for the GetX package.
always-remove-getx-listener

Warns when a GetX event listener is added but never removed

#correctness#memory-leak
⚙️🛠
avoid-getx-rx-inside-build

Warns when GetX Rx primitives are instantiated inside the build method

#correctness
⚙️🛠
avoid-mutable-rx-variables

Warns when GetX Rx primitives are declared as mutable variables

#correctness
⚙️🛠
dispose-getx-fields

Warns when a widget state field is not disposed in the onClose method

#correctness#memory-leak
⚙️🛠
proper-getx-super-calls

Checks that super calls in the onStart, onInit, onClose and onDelete methods are called in the correct order

#correctness
⚙️🛠

Pubspec 9 rules

caution
Pubspec rules should be added to the pubspec-rules: config section.
avoid-any-version

Warns when a dependency version is set as any

#maintainability
⚙️🛠
avoid-dependency-overrides

Warns when a pubspec file has the dependency_overrides section

#maintainability
⚙️🛠
banned-dependencies

Warns when a pubspec contains a banned dependency

#maintainability#requires-config
⚙️🛠
prefer-caret-version-syntax

Warns when a dependency version is listed not with the caret syntax

#maintainability
⚙️🛠
prefer-correct-package-name

Warns when a package name does not match the config

#consistency#requires-config
⚙️🛠
prefer-correct-screenshots

Warns when a screenshots section has incorrect entries

#correctness
⚙️🛠
prefer-pinned-version-syntax

Warns when a dependency version is not specified as the exact version

#maintainability
⚙️🛠
prefer-publish-to-none

Warns when a pubspec file does not have publish_to: none config

#maintainability
⚙️🛠
prefer-semver-version

Warns when a package version does not match the semantic versioning approach

#consistency#maintainability
⚙️🛠

Intl 6 rules

note
Lint rules for the Intl package.
prefer-date-format

Warns when DateTime, values are formatted with toString instead of DateFormat.format()

#correctness
⚙️🛠
prefer-intl-name

Recommends to use ClassName_ClassMemberName pattern for Intl methods name argument

#consistency#readability
⚙️🛠
prefer-number-format

Warns when int, num or double values are formatted with toString instead of NumberFormat.format()

#correctness
⚙️🛠
prefer-providing-intl-description

Warns when an Intl method invoked without a description

#maintainability
⚙️🛠
prefer-providing-intl-examples

Warns when an Intl method invoked without an examples argument or has it incomplete

#maintainability
⚙️🛠
provide-correct-intl-args

Warns when the Intl.message() invocation has incorrect args

#correctness
⚙️🛠

Easy Localization 1 rule

note
avoid-missing-tr

Warns when the tr extension method is not called on localization keys

#correctness
⚙️🛠
No rules found with provided filter criteria.