dart_analysis 1.0.0 copy "dart_analysis: ^1.0.0" to clipboard
dart_analysis: ^1.0.0 copied to clipboard

Lint rules for Dart and Flutter

Dart Analysis #

Developed for kittens 🐾


This package provides lint rules for Dart and Flutter which are recommended by Effective Dart and Lint rules.

Usage #

To use the lints, add as a dev dependency in your pubspec.yaml:

dev_dependencies:
  dart_analysis: ^1.0.0
copied to clipboard

Then, add an include in analysis_options.yaml:

include: package:dart_analysis/analysis_options.yaml
copied to clipboard

Suppressing Lints #

There may be cases where specific lint rules are undesirable. Lint rules can be suppressed at the line, file, or project level.

An example use case for suppressing lint rules at the file level is suppressing the use_super_parameters in all code coverage.

Line Level #

To suppress a specific lint rule for a specific line of code, use an ignore comment directly above the line:

class A {
  A({int? x, int? y});
}
class B extends A {
  // ignore: use_super_parameters
  B({int? x, int? y}) : super(x: x, y: y);
}
copied to clipboard

File Level #

To suppress a specific lint rule of a specific file, use an ignore_for_file comment at the top of the file:

// ignore_for_file: use_super_parameters

class A {
  A({int? x, int? y});
}

class B extends A {
  B({int? x, int? y}) : super(x: x, y: y);
}
copied to clipboard

Project Level #

To suppress a specific lint rule for an entire project, modify analysis_options.yaml:

include: package:dart_analysis/analysis_options.yaml
linter:
  rules:
    use_super_parameters: false
copied to clipboard
9
likes
140
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.16 - 2025.03.31

Lint rules for Dart and Flutter

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

MIT (license)

More

Packages that depend on dart_analysis