effective_dart 1.2.1

  • Readme
  • Changelog
  • Installing
  • 90

effective_dart #

pub package License: MIT style: effective dart

Be consistent. Be brief.

This package provides linter rules corresponding to the guidelines in Effective Dart. You can easily see all enabled rules on the Supported Lint Rules site.

Note: This package is inspired by the pedantic package, which contains lints internally used at Google.

Using the Lints #

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

dev_dependencies:
  effective_dart: ^1.2.0

Then add an include in your analysis_options.yaml file:

include: package:effective_dart/analysis_options.yaml

Or, if you using e.g. continuous builds, they will likely fail whenever a new version of package:effective_dart is released. To avoid this, specify a version of analysis_options.yaml:

include: package:effective_dart/analysis_options.1.2.0.yaml

Consider Lints #

Consider guidelines are practices that you might or might not want to follow, depending on circumstances, precedents, and your own preference.

Following lints are not enforced by this package:

Unused Lints #

Following lints have been considered and will not be enforced by this package:

Suppressing Lints #

There are situations when you want to suppress a specific lint rule. You can suppress lints alone in your project on multiple levels. We will go through examples of how to suppress public_member_api_docs lint rule.

Note: this package provides linter rules corresponding to the guidelines in Effective Dart. That means we generally do not want to disable a rule in this package if it works properly. Yet, if you think some rule should be disabled by this package, open an issue.

Line Level #

To suppress a specific lint rule on a line of code, you can put an ignore comment above the line of code:

// ignore: public_member_api_docs
class MyClass {}

File Level #

To suppress a specific lint rule on a file, you can put an ignore_for_file comment to the file:

// ignore_for_file: public_member_api_docs

class MyClass {}

class MySecondClass {}

Project Level #

To suppress a specific lint rule on a project, you can modify your analysis_options.yaml file:

include: package:effective_dart/analysis_options.yaml

linter:
  rules:
    public_member_api_docs: false

Badge #

Show the world you're following Effective Dartstyle: effective dart

[![style: effective dart][https://img.shields.io/badge/style-effective_dart-40c4ff.svg]](https://github.com/tenhobi/effective_dart)

License #

Licensed under the MIT License.

Changelog #

This project adheres to Semantic Versioning.

1.2.1 #

1.2.0 #

1.1.2 #

  • Updated documentation with a chapter about consider lints
  • Added links to lints mentioned in README

1.1.0 #

1.0.1 #

  • Fixed SDK version
  • Enhanced README

1.0.0 #

  • Added linst according to the current state of the Effective Dart analysis_options.yaml

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  effective_dart: ^1.2.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

Popularity:
Describes how popular the package is relative to other packages. [more]
91
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
90
Learn more about scoring.

We analyzed this package on May 28, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.2
  • pana: 0.13.8-dev

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Make sure dartdoc successfully runs on your package's source files. (-10 points)

exitCode: 255 stdout: Documenting effective_dart... Initialized dartdoc with 37 libraries in 29.7 seconds Validating docs... Documented 0 public libraries in 6.4 seconds stderr: warning: dartdoc generated a broken link to: LICENSE, linked to from package-effective_dart: file:///tmp/pub-dartlang-dartdocCAPHII/pkg found 1 warning and 0 errors Unhandled exception: dartdoc could not find any libraries to document #0 Dartdoc.generateDocs (package:dartdoc/dartdoc.dart:218:9)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0