runtime_lints 0.2.0 copy "runtime_lints: ^0.2.0" to clipboard
runtime_lints: ^0.2.0 copied to clipboard

outdated

Recommended linting/analysis rules for OpenRuntime Github Organization

Runtime Lints #

pub package License: MIT style: very good analysis


This package provides lint + static analysis rules for Dart and Flutter which are used internally on all open-runtime repositories which power the Runtime.Dev platform.

Inspiration #

There are a lot of community driven efforts to create a recommended set of linting rules. Their work inspired this repository.

Exploring Linting + Analysis Rules #

To learn more about Flutter/Dart linting and understanding what the individual rules mean and why they exist, check out the official Dart documentation.

You can also look at the Github Pages hosted version of these linter rules which offer better experience by pairing easy-to-understand good/bad example snippets that showcase the rules and their usage.

Usage #

  1. To use the lints, add a dependency in your pubspec.yaml. Use the Runtime Lints as a dev dependency to prevent users of your library from being forced to download runtime_lints:
dev_dependencies:
  runtime_lints: ^0.1.0
  1. Set the include: in your project's analysis_options.yaml. This will ensure you always use the latest version of the linters and analysis rules:
include: package:runtime_lints/recommended.yaml

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 prefer_const_constructors in order to achieve 100% code coverage. This is due to the fact that const constructors are executed before the tests are run, resulting in no coverage collection.

Line Level #

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

// ignore: public_member_api_docs
class A {}

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: public_member_api_docs

class A {}

class B {}

Project Level #

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

include: package:runtime_lints/recommended.yaml
linter:
  rules:
    public_member_api_docs: false

Badge #

To indicate your project is using runtime_lintsstyle: runtime lints

[![style: runtime lints](https://img.shields.io/badge/style-runtime_lints-B22C89.svg)](https://pub.dev/packages/runtime_lints)
2
likes
0
pub points
34%
popularity

Publisher

verified publisherruntime.dev

Recommended linting/analysis rules for OpenRuntime Github Organization

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter_lints

More

Packages that depend on runtime_lints