Linter rules corresponding to the guidelines in Effective Dart

Overview

effective_dart

pub package License: MIT

This package is deprecated.

Before it was deprecated, it was the way to provide analysis options corresponding to the guidelines in Effective Dart.

Instead, please see official packages: package:lints which is the lint recommendation from the Dart team, or package:flutter_lints which extends that for Flutter.


License

Licensed under the MIT License.

Comments
  • Excluding files

    Excluding files

    Hi, How can I set files to ignoring? I have generated code (intl), and I don't want notifications about that. "Exclude" parameter doesn't work.

    question 
    opened by michaldev 9
  • Add rules for v1.2.0

    Add rules for v1.2.0

    opened by tenhobi 7
  • Disable `omit_local_variable_types` rule

    Disable `omit_local_variable_types` rule

    I think we could disable omit_local_variable_types by default.

    At the moment, below code will cause a warning

    User user = repo.getUser();
    

    But this one will not:

    var user = repo.getUser();
    

    However, User user = ... will make code easy to understand, and if anyone needs to view User source code, he can press Ctrl and click on User to navigate to User class. I believe after compiling, such var will be replaced by the correct type (User).

    Thus, I think we should disable omit_local_variable_types by default.

    feedback wanted 
    opened by anticafe 6
  • Reflect rules's

    Reflect rules's "severity" using analyser

    From the Effective Dart, you have these severity types:

    • DO guidelines describe practices that should always be followed. There will almost never be a valid reason to stray from them.
    • DON’T guidelines are the converse: things that are almost never a good idea. Hopefully, we don’t have as many of these as other languages do because we have less historical baggage.
    • PREFER guidelines are practices that you should follow. However, there may be circumstances where it makes sense to do otherwise. Just make sure you understand the full implications of ignoring the guideline when you do.
    • AVOID guidelines are the dual to “prefer”: stuff you shouldn’t do but where there may be good reasons to on rare occasions.
    • CONSIDER guidelines are practices that you might or might not want to follow, depending on circumstances, precedents, and your own preference.

    And as I understand, you can use four types of severity for analyzer:

    • error
    • warning
    • info
    • ignore

    And more info about how it can be done here: https://dart.dev/guides/language/analysis-options#the-analysis-options-file


    I would like to (and this is not opinionated, it would be nice to have in general to determine these types from the guide in the editor) reflect the type of usage from guidelines in Effective Dart, so do and don't rules are treated as they have to be done this way and prefer and avoid as only optional? With that, without enabling thins like --fatal-infos and --fatal-warnings, it would be good if analyzer would fail for dos and don'ts and don't fail for prefers and avoids.

    1. Does this have a sense, is it worth it?

    For example, in pedantic package, there is written "By default we disallow checking in code with any errors, warnings, or hints." and that might work if all the lints are given the same severity, but Effective Dart doesn't have this benefit. 🤷‍♂️

    1. Can I use error for dos and don'ts, or it's too hard? Should I use warning for that?
    2. If error will be used for dos and don'ts, then warning for prefers and avoids and info for considers?
    3. if considers would have info, and therefore be shown as a "something" from Dart Analyser, wouldn't that force people to use it, whereas this section isn't always what you want to do? So maybe omit considers?

    I would like some comments, mostly to be as aligned as possible with the guide intention. Maybe cc @pq @kwalrath ...

    enhancement feedback wanted 
    opened by tenhobi 4
  • Support null-safety

    Support null-safety

    Hello! thanks for the awesome package.

    Dart 2.12 and flutter 2.0.0 are now in stable with the null-safety feature.

    Migrating this package to null-safety would help a lot. :)

    enhancement 
    opened by isorensen 3
  • Parsing script

    Parsing script

    It would be nice, since we collect lints manually, to create some easy script, which would create us the output list of lints. The script should generate similar style to the existing one.

    Additionally, we also might add ignored lints option, so the script would comment those. (we might create file with ignore rules; as e.g. tool/ignored-lints.yaml).

    Also, the script should output "no diff" or generate new file.

    For pages:

    • https://dart.dev/guides/language/effective-dart/style
    • https://dart.dev/guides/language/effective-dart/documentation
    • https://dart.dev/guides/language/effective-dart/usage
    • https://dart.dev/guides/language/effective-dart/design

    The script may be saved as tool/collect.sh file.

    documentation enhancement help wanted good first issue 
    opened by tenhobi 3
  • ignore_for_file:  non_constant_identifier_names doesn't work in enum

    ignore_for_file: non_constant_identifier_names doesn't work in enum

    using effective_dart: ^1.3.0 // ignore_for_file: non_constant_identifier_names

    doesn't seem to work here

    logs
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:23:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:24:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:25:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:26:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:27:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:28:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:29:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:30:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:31:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:32:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:33:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:37:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:38:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:39:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:40:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:41:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:45:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:46:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:47:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:48:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:49:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:50:3 • constant_identifier_names
       info • Prefer using lowerCamelCase for constant names • subiquity_client/lib/src/types.dart:51:3 • constant_identifier_names
    
    23 issues found. (ran in 19.7s; 146 public members lack documentation)
    

    maybe related to this https://github.com/dart-lang/linter/issues/204

    opened by iapicca 2
  • Explain the difference to pedantic

    Explain the difference to pedantic

    The README says that this is heavily influenced by pedantic. But it's unclear what the goal or difference is. It would be great if you could add a small sentence or paragraph to the README explaining the difference between the two, so it's easier to decide whether pedantic or effective should be used.

    Thanks

    question 
    opened by enyo 2
  • How to automatically apply changes in auto formatting?

    How to automatically apply changes in auto formatting?

    Hello! I would like to know how to put certain actions to be executed automatically when the auto formatter is used.

    I'm currently using VS Code, and I would like all my imports to be changed to relative imports, and then, automatically organized. Any idea how to do this?

    opened by pedrolemoz 2
  • Improving Pub points

    Improving Pub points

    According to pub.dev this package has 80/100. I like the package, but thought it didn't reflect well for effective_dart to have a less than perfect score. Most of them are silly stuff on the readme, and missing example file.

    This should get the score to 110

    Reference: https://pub.dev/packages/effective_dart/score

    opened by leoafarias 2
  • Add async related rules

    Add async related rules

    I wan to suggest to add the following rules to the effective dart analysis options:

    • avoid_void_async
    • await_only_futures

    I find these lint rules extremely important as the helped me to find and avoid multiple issues in cases where you simply forget to add the async keyword to a method definition and try to await the result, although the method isn't really executed asynchronously. I can not think of a case where it would be reasonable to omit these rules.

    question 
    opened by devjeff 2
Releases(v1.3.1)
Owner
Honza Bittner
25 y.o., a student at @cvut. In love with @dart-lang and @flutter.
Honza Bittner
At its core, Mah-Event lets end-users initiate and find events corresponding to their interests and location

Mah-Event Application At its core, Mah-Event lets end-users initiate and find events corresponding to their interests and location. It allows people t

Palm Jumnongrat 2 Mar 14, 2022
The Import Lint package defines import lint rules and report on lints found in Dart code.

Why import lint? The Import Lint package defines import lint rules and report on lints found in Dart code. ?? Usage Add import_lint as a dev_dependenc

ryo 12 Jul 17, 2022
Rules - Powerful and feature-rich validation library for both Dart and Flutter.

Introduction Rules - Powerful and feature-rich validation library for both Dart and Flutter. Rules is a simple yet powerful and feature-rich validatio

Ganesh Rathinavel 25 Sep 7, 2022
An opinionated, community-driven set of lint rules for Dart and Flutter projects. Like pedantic but stricter

Lint for Dart/Flutter lint is a hand-picked, open-source, community-driven collection of lint rules for Dart and Flutter projects. The set of rules fo

Pascal Welsch 245 Sep 20, 2022
A super effective dart library delivering performance & ensuring greater build speed.

A super effective Dart and Flutter library for delivering performante app ?? & ensuring greater build speed ?? . The package has some cook utilizes wh

Rexford Asamoah 2 Nov 22, 2021
A collection of pixel-perfect iOS-styled components and properties for Flutter, following the official guidelines.

cupertinew ⚠️ Experimental and work in progress ⚠️ A collection of pixel-perfect iOS-styled components and properties for Flutter, following the offic

Jeroen Meijer (Jay) 30 Jun 17, 2022
Material io ext - A collection of extensions for creating widgets following material.io guidelines

material_io_ext It is a collection of extensions for creating widgets following

BetterX.io 3 Jan 28, 2022
Flutter themes consistent with GitHub's Primer style guidelines

primer_flutter Flutter themes consistent with Primer style guidelines DISCLAIMER: This project is not affiliated with the Primer or GitHub organizatio

Reuben Turner 6 Aug 24, 2022
腾讯云 1 Feb 10, 2022
A lightweight & effective Todo app made with Flutter

Blue Diary A lightweight & effective Todo app made with Flutter. Supports English and Korean. Screenshots • Download • Usage • Architecture • Feedback

Hansol Lee 151 Sep 15, 2022
The XOR Encryption algorithm is a effective and easy to implement method of symmetric encryption.

Symmetric XOR cipher library About XOR cipher XOR Encryption is an encryption method used to encrypt data and is hard to crack by brute-force method,

Plague Fox 7 Apr 20, 2022
🎨 An opinionated, effective and correct way to provide multiple themes to your app.

theming This is an opinionated and effective way to provide multi-theme choice for your app. theming depends on provider and shared_preference for sta

Chinyeaka Chinonso 3 Sep 1, 2022
Mysql.dart - MySQL client for Dart written in Dart

Native MySQL client written in Dart for Dart See example directory for examples

null 41 Sep 22, 2022
Docker images for the Dart programming language (https://dart.dev)

dart-docker This is the Git repo of the Docker "Official Images" for the Dart programming language. See the Docker Hub page for a full description on

Dart 43 Sep 15, 2022
A most easily usable Duolingo API wrapper in Dart. Duolingo4D is an open-sourced Dart library.

A most easily usable Duolingo API wrapper in Dart! 1. About Duolingo4D Duolingo4D is an open-sourced Dart library. With Duolingo4D, you can easily int

Kato Shinya 15 Jul 20, 2022
dna, dart native access. A lightweight dart to native super channel plugin

dna, dart native access. A lightweight dart to native super channel plugin, You can use it to invoke any native code directly in contextual and chained dart code.

Assuner 14 Jul 11, 2022
Dart package responsible to provide the basic resources to Lambda Functions with Clean Dart

AWS Lambda Core This package is responsible to provide the basic resources to all services; Usage pubspec.yaml dependencies: aws_lambda_core: <laste

David Araujo 1 Dec 2, 2021
A Dart client for the NATS messaging system. Design to use with Dart and Flutter.

Dart-NATS A Dart client for the NATS messaging system. Design to use with Dart and flutter. Flutter Web Support by WebSocket client.connect(Uri.parse(

Chart Chongcharoen 26 Aug 26, 2022