11# RydMike LINTER Preferences v2.3.0
2- # TODO(rydmike): Review and publish this v2.3.0 updated version.
32#
43# Get this file here: https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
54#
65# We include and activate all lint rules, later below we disable the not used or desired ones.
76# You can find a list of all lint rules to put in your all_lint_rules.yaml file here:
87# https://dart.dev/tools/linter-rules/all
98#
9+ # This version is updated for Flutter 3.27 and Dart 3.6.
10+ #
1011# For a comparison of all lint rules settings in rule styles listed below, please see this Google
1112# sheet: https://docs.google.com/spreadsheets/d/1Nc1gFjmCOMubWZD7f2E4fLhWN7LYaOE__tsA7bf2NjA
1213#
1314# Versions used for comparison:
14- # TODO(rydmike): Update the used comparisons to their latest version.
1515#
16- # Core v3.0.0 : https://pub.dev/packages/lints
17- # Recommended v3.0.0 : https://pub.dev/packages/lints
18- # Flutter Lints v3 .0.1 : https://pub.dev/packages/flutter_lints
16+ # Core v5.1.1 : https://pub.dev/packages/lints
17+ # Recommended v5.1.1 : https://pub.dev/packages/lints
18+ # Flutter Lints v5 .0.0 : https://pub.dev/packages/flutter_lints
1919# Pedantic v1.11.1 : https://pub.dev/packages/pedantic
2020# Effective Dart v1.3.2 : https://pub.dev/packages/effective_dart
2121# Flutter repo master : https://github.com/flutter/flutter/blob/master/analysis_options.yaml
22- # Lint v2.2.0 : https://pub.dev/packages/lint
23- # VG Analysis v5.1.0 : https://pub.dev/packages/very_good_analysis
24- # RydMike v2.1.0 : https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
25- #
22+ # Lint v2.3.0 : https://pub.dev/packages/lint
23+ # VG Analysis v7.0.0 : https://pub.dev/packages/very_good_analysis
24+ # RydMike v2.3.0 : https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
2625include : all_lint_rules.yaml
2726analyzer :
2827 exclude :
@@ -249,6 +248,9 @@ linter:
249248 # where we voluntarily want to catch everything, especially as a library.
250249 # See https://github.com/dart-lang/linter/issues/3023
251250 #
251+ # The above issue has been resolved and closed, so the rule is now enabled
252+ # starting in version 2.3.0.
253+ #
252254 # Other known linters use:
253255 #
254256 # Core disabled : https://pub.dev/packages/lints
@@ -259,8 +261,11 @@ linter:
259261 # Flutter repo disabled : https://github.com/flutter/flutter/blob/master/analysis_options.yaml
260262 # Lint disabled : https://pub.dev/packages/lint
261263 # VG Analysis disabled : https://pub.dev/packages/very_good_analysis
262- # RydMike disabled : https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
263- avoid_catches_without_on_clauses : false
264+ # RydMike : https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
265+ # PACKAGE: enabled : By commenting it out below.
266+ # APPLICATION: disabled : With false value.
267+ #
268+ # avoid_catches_without_on_clauses: false
264269
265270 # AVOID defining a class that contains only static members.
266271 #
@@ -501,8 +506,9 @@ linter:
501506 #
502507 # https://dart.dev/tools/linter-rules/diagnostic_describe_all_properties.html
503508 #
504- # Consider using this lint rule if you are making a public Flutter package, for private ones and private apps
505- # we recommend keeping it off as you probably won't be making diagnostic properties for all your
509+ # Consider using this lint rule if you are making a public Flutter package.
510+ # For private ones and private apps we recommend keeping it off as you probably
511+ # won't be making diagnostic properties for all your
506512 # classes, unless you are using a data class lib that does it for you via code generation.
507513 #
508514 # Other known linters use:
@@ -513,10 +519,10 @@ linter:
513519 # Pedantic disabled : https://pub.dev/packages/pedantic
514520 # Effective Dart disabled : https://pub.dev/packages/effective_dart
515521 # Lint disabled : https://pub.dev/packages/lint
516- # Flutter repo disabled : https://github.com/flutter/flutter/blob/master/analysis_options.yaml
522+ # Flutter repo ENABLED? disabled : https://github.com/flutter/flutter/blob/master/analysis_options.yaml
517523 # VG Analysis disabled : https://pub.dev/packages/very_good_analysis
518524 # RydMike : https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
519- # PACKAGE: enabled : By commenting it out.
525+ # PACKAGE: enabled : By commenting it out, sometimes use it, not always .
520526 # APPLICATION: disabled : With false value. (Default, assume we are making an app most of the time.)
521527 diagnostic_describe_all_properties : false
522528
@@ -549,8 +555,10 @@ linter:
549555 #
550556 # Document ignore comments.
551557 #
552- # RydMike: THis is good, but putting it false for now, as it is triggered a lot
553- # in code bases that did not do this. Consider keeping it on for new projects.
558+ # RydMike: This is good, but putting it false for now. This lint is triggered a lot
559+ # in our code bases that did not do this originally.
560+ # Consider enabling it for new projects. May enable later in older projects too and
561+ # add explanations to all the ignored rules.
554562 #
555563 # Other known linters use:
556564 #
@@ -561,7 +569,7 @@ linter:
561569 # Effective Dart disabled : https://pub.dev/packages/effective_dart
562570 # Lint disabled : https://pub.dev/packages/lint
563571 # Flutter repo disabled : https://github.com/flutter/flutter/blob/master/analysis_options.yaml
564- # VG Analysis disabled : https://pub.dev/packages/very_good_analysis
572+ # VG Analysis enabled : https://pub.dev/packages/very_good_analysis
565573 # RydMike disabled : https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
566574 document_ignores : false
567575
@@ -692,8 +700,8 @@ linter:
692700 # Pedantic disabled : https://pub.dev/packages/pedantic
693701 # Effective Dart disabled : https://pub.dev/packages/effective_dart
694702 # Flutter repo disabled : https://github.com/flutter/flutter/blob/master/analysis_options.yaml
695- # Lint ? : https://pub.dev/packages/lint
696- # VG Analysis ? : https://pub.dev/packages/very_good_analysis
703+ # Lint disabled : https://pub.dev/packages/lint
704+ # VG Analysis disabled : https://pub.dev/packages/very_good_analysis
697705 # RydMike disabled : https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
698706 omit_obvious_local_variable_types : false
699707
@@ -797,8 +805,8 @@ linter:
797805 #
798806 # https://dart.dev/tools/linter-rules/prefer_expression_function_bodies.html
799807 #
800- # Certainly a good idea in many cases, but not always. For example, not always suitable for
801- # Flutter, which may have a `build` method with a single return, but that return is still
808+ # Certainly a good idea in many cases, but not always. For example, it is not always suitable for
809+ # Flutter, which may have a `build` method with a single return. This return is still
802810 # complex enough that a "body" is worth it, and it might not even fit on a single line.
803811 # https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
804812 #
@@ -850,7 +858,7 @@ linter:
850858 # https://dart.dev/tools/linter-rules/prefer_int_literals.html
851859 #
852860 # This rule goes against the preferred style of being explicit with
853- # declarations and hides when a number is double, since we cannot declare it
861+ # declarations and hides when a number is double. We cannot declare it
854862 # as 0.0 or 1.0 when it is double, it has to be 0 or 1, making it look
855863 # like an integer, even if it is not. Sometimes doing that is OK, but let's
856864 # not enforce it.
@@ -893,11 +901,11 @@ linter:
893901 # Effective Dart enabled : https://pub.dev/packages/effective_dart
894902 # Flutter repo disabled : https://github.com/flutter/flutter/blob/master/analysis_options.yaml
895903 # Lint disabled : https://pub.dev/packages/lint
896- # VG Analysis enabled : https://pub.dev/packages/very_good_analysis
904+ # VG Analysis disabled : https://pub.dev/packages/very_good_analysis
897905 # RydMike : https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
898906 # PACKAGE: enabled : By commenting it out. (My default, I start with this)
899907 # APPLICATION: disabled : With false value. (But usually uncomment the false value if it is an app)
900- public_member_api_docs : false
908+ # public_member_api_docs: false
901909
902910 # DO use trailing commas for all function calls and declarations unless the function call or
903911 # definition, from the start of the function name up to the closing parenthesis,
@@ -926,13 +934,20 @@ linter:
926934 #
927935 # We do like this lint rule, but we want to have the default constructor first, followed
928936 # by its properties, after this, other named constructors and factories. This rule gets
929- # in the way of that and forces you to put (often final) constructor properties after all
937+ # in the way of that. It forces you to put (often final) constructor properties after all
930938 # the named constructors and factories, making them tedious to find and disconnected from
931939 # where we want to see, read and handily edit them. This is especially the case if there are
932940 # many constructors and factories, and they have a lot of parameters. For now, we disable
933- # this rule and order things as described above, which apart from the default constructor
934- # properties coming right after the constructor, is the only part where we in practice
935- # deviate from this rule, so other yes, we do put constructors first as well anyway.
941+ # this rule and order things as described above. The default constructor properties coming
942+ # right after the constructor, is the only part where we in practice
943+ # deviate from this rule, so otherwise yes, we do put constructors first as well anyway.
944+ #
945+ # From version v2.3.0 started using this rule, but add exceptions for files with
946+ # classes that have a lot of properties and factory constructors. In those cases,
947+ # we disable this rule, so we can get a better overview of the class properties
948+ # and main constructor, before the factory constructors.
949+ #
950+ # Remove the comment below to disable this rule again.
936951 #
937952 # Other known linters use:
938953 #
@@ -945,8 +960,8 @@ linter:
945960 # Lint disabled : https://pub.dev/packages/lint
946961 # Discussion https://github.com/passsy/dart-lint/issues/1
947962 # VG Analysis enabled : https://pub.dev/packages/very_good_analysis
948- # RydMike disabled : https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
949- sort_constructors_first : false
963+ # RydMike enabled : https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
964+ # sort_constructors_first: false
950965
951966 # DON'T use final for local variables.
952967 #
0 commit comments