From 99a8aa657c299af839a899d3c605240f5bbae17d Mon Sep 17 00:00:00 2001 From: Ilyasov Ainur Date: Tue, 23 Apr 2024 16:28:06 +0300 Subject: [PATCH 1/9] fix: widgets-order ordering --- lib/dart.yaml | 390 +++++++++++++++++++++++++------------------------- 1 file changed, 197 insertions(+), 193 deletions(-) diff --git a/lib/dart.yaml b/lib/dart.yaml index 1a27e9a..043ebb1 100644 --- a/lib/dart.yaml +++ b/lib/dart.yaml @@ -1,194 +1,198 @@ dart_code_metrics: - rules: - # https://dcm.dev/docs/rules/common - - arguments-ordering: - child-last: true - - avoid-accessing-collections-by-constant-index - - avoid-accessing-other-classes-private-members - - avoid-async-call-in-sync-function - - avoid-barrel-files - - avoid-bottom-type-in-patterns - - avoid-bottom-type-in-records - # https://github.com/dart-lang/sdk/issues/45667 - - avoid-cascade-after-if-null - - avoid-collapsible-if - - avoid-collection-methods-with-unrelated-types - - avoid-declaring-call-method - - avoid-double-slash-imports - - avoid-duplicate-cascades - - avoid-duplicate-collection-elements - - avoid-duplicate-exports - - avoid-duplicate-initializers - - avoid-duplicate-map-keys - - avoid-duplicate-mixins - - avoid-duplicate-named-imports - - avoid-duplicate-patterns - - avoid-duplicate-switch-case-conditions - - avoid-duplicate-test-assertions - - avoid-dynamic - - avoid-equal-expressions - - avoid-explicit-pattern-field-name - - avoid-explicit-type-declaration - - avoid-extensions-on-records - - avoid-function-type-in-records - - avoid-future-tostring - - avoid-generics-shadowing - - avoid-global-state - - avoid-identical-exception-handling-blocks - - avoid-ignoring-return-values - - avoid-inverted-boolean-checks - - avoid-keywords-in-wildcard-pattern - - avoid-local-functions - - avoid-long-files: - max-length: 500 - - avoid-long-functions: - max-length: 80 - ignored-names: - - build - - avoid-long-parameter-list: - ignore-optional: true - max-amount: 5 - ignored-names: - - copyWith - - avoid-long-records: - max-amount: 3 - # https://github.com/dart-lang/sdk/issues/52909 - - avoid-map-keys-contains - - avoid-missed-calls - - avoid-missing-enum-constant-in-map - - avoid-missing-interpolation - - avoid-misused-wildcard-pattern - - avoid-mixing-named-and-positional-fields - - avoid-mutating-parameters - - avoid-negated-conditions - - avoid-nested-conditional-expressions: - acceptable-level: 2 - - avoid-nested-futures - - avoid-nested-records - - avoid-nested-streams-and-futures - - avoid-nested-switch-expressions - - avoid-nested-switches - - avoid-non-null-assertion - - avoid-nullable-interpolation - - avoid-nullable-parameters-with-default-values - - avoid-nullable-tostring - - avoid-one-field-records - - avoid-passing-async-when-sync-expected - - avoid-passing-default-values - - avoid-passing-self-as-argument - - avoid-positional-record-field-access - - avoid-recursive-calls - - avoid-redundant-async - - avoid-redundant-else - - avoid-referencing-discarded-variables - - avoid-self-assignment - - avoid-self-compare - - avoid-shadowed-extension-methods - - avoid-shadowing - - avoid-throw-in-catch-block - - avoid-throw-objects-without-tostring - - avoid-unassigned-late-fields - - avoid-unassigned-stream-subscriptions - - avoid-unconditional-break - - avoid-unnecessary-conditionals - - avoid-unnecessary-futures - - avoid-unnecessary-if - - avoid-unnecessary-local-late - - avoid-unnecessary-negations - - avoid-unnecessary-nullable-return-type - - avoid-unnecessary-return - - avoid-unnecessary-super - - avoid-unsafe-collection-methods - - avoid-unused-after-null-check - - avoid-unused-parameters - - binary-expression-operand-order - - double-literal-format: - explicit-trailing-zero: true - - format-comment: - only-doc-comments: false - - function-always-returns-null - - map-keys-ordering - - match-positional-field-names-on-assignment - - member-ordering: - order: - - public-fields - - private-fields - - public-getters - - private-getters - - public-setters - - private-setters - - constructors - - close-method - - dispose-method - - public-methods - - private-methods - widgets-order: - - constructor - - named-constructor - - const-fields - - final-fields - - init-state-method - - did-change-dependencies-method - - did-update-widget-method - - dispose-method - - private-methods - - overriden-public-methods - - build-method - - move-records-to-typedefs: - min-fields: 3 - min-occurences: 2 - - move-variable-closer-to-its-usage - - move-variable-outside-iteration - - newline-before-return - - no-boolean-literal-compare - - no-empty-block - - no-equal-arguments: - ignored-parameters: - - height - - width - - no-equal-conditions - - no-equal-nested-conditions - - no-equal-switch-case - - no-equal-switch-expression-cases - - no-equal-then-else - - no-magic-number: - allowed: [ -1, 0, 1 ] - - no-object-declaration - - prefer-addition-subtraction-assignments - - prefer-any-or-every - - prefer-correct-callback-field-name: - name-pattern: ^on[A-Z]+ - - prefer-correct-error-name: - allowed-names: [ error, exception, failure ] - - prefer-correct-identifier-length: - max-identifier-length: 30 - min-identifier-length: 2 - - prefer-correct-stream-return-type - - prefer-declaring-const-constructor: - ignore-abstract: true - - prefer-early-return: - ignore-if-case: true - - prefer-explicit-function-type - - prefer-explicit-type-arguments - - prefer-immediate-return - - prefer-match-file-name: - exclude: - - "test/**" - - "lib/**/*wm.dart" - - prefer-moving-to-variable: - allowed-duplicated-chains: 3 - - prefer-named-boolean-parameters: - ignore-single: true - ignore-single-boolean: false - - prefer-null-aware-spread - - prefer-parentheses-with-if-null - - prefer-public-exception-classes - - prefer-return-await - - prefer-simpler-patterns-null-check - - prefer-switch-with-enums - - prefer-test-matchers - - prefer-typedefs-for-callbacks - - prefer-unique-test-names - - prefer-wildcard-pattern - # Style - - unnecessary-trailing-comma: false + rules: + # https://dcm.dev/docs/rules/common + - arguments-ordering: + last: + - body + - child + - children + - avoid-accessing-collections-by-constant-index + - avoid-accessing-other-classes-private-members + - avoid-async-call-in-sync-function + - avoid-barrel-files + - avoid-bottom-type-in-patterns + - avoid-bottom-type-in-records + # https://github.com/dart-lang/sdk/issues/45667 + - avoid-cascade-after-if-null + - avoid-collapsible-if + - avoid-collection-methods-with-unrelated-types + - avoid-declaring-call-method + - avoid-double-slash-imports + - avoid-duplicate-cascades + - avoid-duplicate-collection-elements + - avoid-duplicate-exports + - avoid-duplicate-initializers + - avoid-duplicate-map-keys + - avoid-duplicate-mixins + - avoid-duplicate-named-imports + - avoid-duplicate-patterns + - avoid-duplicate-switch-case-conditions + - avoid-duplicate-test-assertions + - avoid-dynamic + - avoid-equal-expressions + - avoid-explicit-pattern-field-name + - avoid-explicit-type-declaration + - avoid-extensions-on-records + - avoid-function-type-in-records + - avoid-future-tostring + - avoid-generics-shadowing + - avoid-global-state + - avoid-identical-exception-handling-blocks + - avoid-ignoring-return-values + - avoid-inverted-boolean-checks + - avoid-keywords-in-wildcard-pattern + - avoid-local-functions + - avoid-long-files: + max-length: 500 + - avoid-long-functions: + max-length: 80 + ignored-names: + - build + - avoid-long-parameter-list: + ignore-optional: true + max-amount: 5 + ignored-names: + - copyWith + - avoid-long-records: + max-amount: 3 + # https://github.com/dart-lang/sdk/issues/52909 + - avoid-map-keys-contains + - avoid-missed-calls + - avoid-missing-enum-constant-in-map + - avoid-missing-interpolation + - avoid-misused-wildcard-pattern + - avoid-mixing-named-and-positional-fields + - avoid-mutating-parameters + - avoid-negated-conditions + - avoid-nested-conditional-expressions: + acceptable-level: 2 + - avoid-nested-futures + - avoid-nested-records + - avoid-nested-streams-and-futures + - avoid-nested-switch-expressions + - avoid-nested-switches + - avoid-non-null-assertion + - avoid-nullable-interpolation + - avoid-nullable-parameters-with-default-values + - avoid-nullable-tostring + - avoid-one-field-records + - avoid-passing-async-when-sync-expected + - avoid-passing-default-values + - avoid-passing-self-as-argument + - avoid-positional-record-field-access + - avoid-recursive-calls + - avoid-redundant-async + - avoid-redundant-else + - avoid-referencing-discarded-variables + - avoid-self-assignment + - avoid-self-compare + - avoid-shadowed-extension-methods + - avoid-shadowing + - avoid-throw-in-catch-block + - avoid-throw-objects-without-tostring + - avoid-unassigned-late-fields + - avoid-unassigned-stream-subscriptions + - avoid-unconditional-break + - avoid-unnecessary-conditionals + - avoid-unnecessary-futures + - avoid-unnecessary-if + - avoid-unnecessary-local-late + - avoid-unnecessary-negations + - avoid-unnecessary-nullable-return-type + - avoid-unnecessary-return + - avoid-unnecessary-super + - avoid-unsafe-collection-methods + - avoid-unused-after-null-check + - avoid-unused-parameters + - binary-expression-operand-order + - double-literal-format: + explicit-trailing-zero: true + - format-comment: + only-doc-comments: false + - function-always-returns-null + - map-keys-ordering + - match-positional-field-names-on-assignment + - member-ordering: + order: + - private-fields + - public-fields + - public-getters + - private-getters + - public-setters + - private-setters + - constructors + - close-method + - init-state-method + - dispose-method + - public-methods + - private-methods + widgets-order: + - const-fields + - final-fields + - constructor + - named-constructor + - init-state-method + - did-change-dependencies-method + - did-update-widget-method + - dispose-method + - overriden-public-methods + - private-methods + - build-method + - move-records-to-typedefs: + min-fields: 3 + min-occurences: 2 + - move-variable-closer-to-its-usage + - move-variable-outside-iteration + - newline-before-return + - no-boolean-literal-compare + - no-empty-block + - no-equal-arguments: + ignored-parameters: + - height + - width + - no-equal-conditions + - no-equal-nested-conditions + - no-equal-switch-case + - no-equal-switch-expression-cases + - no-equal-then-else + - no-magic-number: + allowed: [-1, 0, 1] + - no-object-declaration + - prefer-addition-subtraction-assignments + - prefer-any-or-every + - prefer-correct-callback-field-name: + name-pattern: ^on[A-Z]+ + - prefer-correct-error-name: + allowed-names: [error, exception, failure] + - prefer-correct-identifier-length: + max-identifier-length: 30 + min-identifier-length: 2 + - prefer-correct-stream-return-type + - prefer-declaring-const-constructor: + ignore-abstract: true + - prefer-early-return: + ignore-if-case: true + - prefer-explicit-function-type + - prefer-explicit-type-arguments + - prefer-immediate-return + - prefer-match-file-name: + exclude: + - "test/**" + - "lib/**/*wm.dart" + - prefer-moving-to-variable: + allowed-duplicated-chains: 3 + - prefer-named-boolean-parameters: + ignore-single: true + ignore-single-boolean: false + - prefer-null-aware-spread + - prefer-parentheses-with-if-null + - prefer-public-exception-classes + - prefer-return-await + - prefer-simpler-patterns-null-check + - prefer-switch-with-enums + - prefer-test-matchers + - prefer-typedefs-for-callbacks + - prefer-unique-test-names + - prefer-wildcard-pattern + # Style + - unnecessary-trailing-comma: false From e90f4303ac50f8f7e96535dcbc5998405310c9be Mon Sep 17 00:00:00 2001 From: Ilyasov Ainur Date: Tue, 23 Apr 2024 17:50:50 +0300 Subject: [PATCH 2/9] fix: rules reordering --- lib/dart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dart.yaml b/lib/dart.yaml index 043ebb1..b5a7155 100644 --- a/lib/dart.yaml +++ b/lib/dart.yaml @@ -116,10 +116,10 @@ dart_code_metrics: order: - private-fields - public-fields - - public-getters - private-getters - - public-setters + - public-getters - private-setters + - public-setters - constructors - close-method - init-state-method From e615d92e8365ba6712b380876d399a9038d9575e Mon Sep 17 00:00:00 2001 From: Ilyasov Ainur Date: Tue, 23 Apr 2024 17:56:35 +0300 Subject: [PATCH 3/9] feat: add parameters-ordering --- lib/dart.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/dart.yaml b/lib/dart.yaml index b5a7155..4a6a603 100644 --- a/lib/dart.yaml +++ b/lib/dart.yaml @@ -6,6 +6,10 @@ dart_code_metrics: - body - child - children + - parameters-ordering: + required: "first" + default: "last" + super: "last" - avoid-accessing-collections-by-constant-index - avoid-accessing-other-classes-private-members - avoid-async-call-in-sync-function From 5edb9128e89807cd3e0e64367103e15a09c36604 Mon Sep 17 00:00:00 2001 From: Ilyasov Ainur Date: Tue, 23 Apr 2024 18:36:47 +0300 Subject: [PATCH 4/9] fix: ordering --- lib/dart.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/dart.yaml b/lib/dart.yaml index 4a6a603..8b1e3a4 100644 --- a/lib/dart.yaml +++ b/lib/dart.yaml @@ -118,15 +118,16 @@ dart_code_metrics: - match-positional-field-names-on-assignment - member-ordering: order: - - private-fields - public-fields - - private-getters + - private-late-final-fields + - private-fields - public-getters - - private-setters + - private-getters - public-setters + - private-setters - constructors - - close-method - init-state-method + - close-method - dispose-method - public-methods - private-methods @@ -135,6 +136,7 @@ dart_code_metrics: - final-fields - constructor - named-constructor + - factory-constructors - init-state-method - did-change-dependencies-method - did-update-widget-method From 9fd92d5135c865c052654369d58b3e8fc08bf4ca Mon Sep 17 00:00:00 2001 From: Ilyasov Ainur Date: Tue, 23 Apr 2024 18:44:53 +0300 Subject: [PATCH 5/9] feat: add elementary methods ordering --- lib/dart.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/dart.yaml b/lib/dart.yaml index 8b1e3a4..fe9a605 100644 --- a/lib/dart.yaml +++ b/lib/dart.yaml @@ -126,7 +126,11 @@ dart_code_metrics: - public-setters - private-setters - constructors - - init-state-method + - init-widget-model-method + - init-method + - did-change-dependencies-method + - did-update-widget-method + - on-error-handle-method - close-method - dispose-method - public-methods From 7110e0bfdf0ee9391f6c4d7f67e5d9eb4679191f Mon Sep 17 00:00:00 2001 From: Ilyasov Ainur Date: Wed, 24 Apr 2024 10:44:15 +0300 Subject: [PATCH 6/9] fix: diable alphabetize parameters-ordering --- lib/dart.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/dart.yaml b/lib/dart.yaml index fe9a605..2334635 100644 --- a/lib/dart.yaml +++ b/lib/dart.yaml @@ -7,6 +7,7 @@ dart_code_metrics: - child - children - parameters-ordering: + alphabetize: false required: "first" default: "last" super: "last" From 3137174cfc865503bdfb568769e207fba9bd27fa Mon Sep 17 00:00:00 2001 From: Ilyasov Ainur Date: Wed, 24 Apr 2024 11:07:26 +0300 Subject: [PATCH 7/9] fix: add app_text_scheme exclude, change member-ordering --- lib/dart.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/dart.yaml b/lib/dart.yaml index 2334635..1d09d0a 100644 --- a/lib/dart.yaml +++ b/lib/dart.yaml @@ -2,15 +2,17 @@ dart_code_metrics: rules: # https://dcm.dev/docs/rules/common - arguments-ordering: + exclude: + - "lib/**/app_text_scheme.dart" last: - body - child - children - parameters-ordering: - alphabetize: false required: "first" default: "last" super: "last" + - avoid-accessing-collections-by-constant-index - avoid-accessing-other-classes-private-members - avoid-async-call-in-sync-function @@ -120,8 +122,8 @@ dart_code_metrics: - member-ordering: order: - public-fields - - private-late-final-fields - private-fields + - private-late-final-fields - public-getters - private-getters - public-setters @@ -138,10 +140,10 @@ dart_code_metrics: - private-methods widgets-order: - const-fields - - final-fields - constructor - named-constructor - factory-constructors + - final-fields - init-state-method - did-change-dependencies-method - did-update-widget-method From 4f238f028ff812b9fd3e8a463d6993250feb6fdd Mon Sep 17 00:00:00 2001 From: Ilyasov Ainur <147477316+ilyasov-ainur@users.noreply.github.com> Date: Wed, 24 Apr 2024 11:13:53 +0300 Subject: [PATCH 8/9] fix: remove exclude --- lib/dart.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/dart.yaml b/lib/dart.yaml index 1d09d0a..7f1d00d 100644 --- a/lib/dart.yaml +++ b/lib/dart.yaml @@ -2,8 +2,6 @@ dart_code_metrics: rules: # https://dcm.dev/docs/rules/common - arguments-ordering: - exclude: - - "lib/**/app_text_scheme.dart" last: - body - child From 648d4db7dc6d0236c33ce21207cd05c039a436a4 Mon Sep 17 00:00:00 2001 From: Ilyasov Ainur Date: Thu, 25 Apr 2024 18:13:11 +0300 Subject: [PATCH 9/9] fix: file formatting, widget member-ordgering --- lib/dart.yaml | 414 +++++++++++++++++++++++++------------------------- 1 file changed, 207 insertions(+), 207 deletions(-) diff --git a/lib/dart.yaml b/lib/dart.yaml index 7f1d00d..2c4f84a 100644 --- a/lib/dart.yaml +++ b/lib/dart.yaml @@ -1,209 +1,209 @@ dart_code_metrics: - rules: - # https://dcm.dev/docs/rules/common - - arguments-ordering: - last: - - body - - child - - children - - parameters-ordering: - required: "first" - default: "last" - super: "last" + rules: + # https://dcm.dev/docs/rules/common + - arguments-ordering: + last: + - body + - child + - children + - parameters-ordering: + required: "first" + default: "last" + super: "last" - - avoid-accessing-collections-by-constant-index - - avoid-accessing-other-classes-private-members - - avoid-async-call-in-sync-function - - avoid-barrel-files - - avoid-bottom-type-in-patterns - - avoid-bottom-type-in-records - # https://github.com/dart-lang/sdk/issues/45667 - - avoid-cascade-after-if-null - - avoid-collapsible-if - - avoid-collection-methods-with-unrelated-types - - avoid-declaring-call-method - - avoid-double-slash-imports - - avoid-duplicate-cascades - - avoid-duplicate-collection-elements - - avoid-duplicate-exports - - avoid-duplicate-initializers - - avoid-duplicate-map-keys - - avoid-duplicate-mixins - - avoid-duplicate-named-imports - - avoid-duplicate-patterns - - avoid-duplicate-switch-case-conditions - - avoid-duplicate-test-assertions - - avoid-dynamic - - avoid-equal-expressions - - avoid-explicit-pattern-field-name - - avoid-explicit-type-declaration - - avoid-extensions-on-records - - avoid-function-type-in-records - - avoid-future-tostring - - avoid-generics-shadowing - - avoid-global-state - - avoid-identical-exception-handling-blocks - - avoid-ignoring-return-values - - avoid-inverted-boolean-checks - - avoid-keywords-in-wildcard-pattern - - avoid-local-functions - - avoid-long-files: - max-length: 500 - - avoid-long-functions: - max-length: 80 - ignored-names: - - build - - avoid-long-parameter-list: - ignore-optional: true - max-amount: 5 - ignored-names: - - copyWith - - avoid-long-records: - max-amount: 3 - # https://github.com/dart-lang/sdk/issues/52909 - - avoid-map-keys-contains - - avoid-missed-calls - - avoid-missing-enum-constant-in-map - - avoid-missing-interpolation - - avoid-misused-wildcard-pattern - - avoid-mixing-named-and-positional-fields - - avoid-mutating-parameters - - avoid-negated-conditions - - avoid-nested-conditional-expressions: - acceptable-level: 2 - - avoid-nested-futures - - avoid-nested-records - - avoid-nested-streams-and-futures - - avoid-nested-switch-expressions - - avoid-nested-switches - - avoid-non-null-assertion - - avoid-nullable-interpolation - - avoid-nullable-parameters-with-default-values - - avoid-nullable-tostring - - avoid-one-field-records - - avoid-passing-async-when-sync-expected - - avoid-passing-default-values - - avoid-passing-self-as-argument - - avoid-positional-record-field-access - - avoid-recursive-calls - - avoid-redundant-async - - avoid-redundant-else - - avoid-referencing-discarded-variables - - avoid-self-assignment - - avoid-self-compare - - avoid-shadowed-extension-methods - - avoid-shadowing - - avoid-throw-in-catch-block - - avoid-throw-objects-without-tostring - - avoid-unassigned-late-fields - - avoid-unassigned-stream-subscriptions - - avoid-unconditional-break - - avoid-unnecessary-conditionals - - avoid-unnecessary-futures - - avoid-unnecessary-if - - avoid-unnecessary-local-late - - avoid-unnecessary-negations - - avoid-unnecessary-nullable-return-type - - avoid-unnecessary-return - - avoid-unnecessary-super - - avoid-unsafe-collection-methods - - avoid-unused-after-null-check - - avoid-unused-parameters - - binary-expression-operand-order - - double-literal-format: - explicit-trailing-zero: true - - format-comment: - only-doc-comments: false - - function-always-returns-null - - map-keys-ordering - - match-positional-field-names-on-assignment - - member-ordering: - order: - - public-fields - - private-fields - - private-late-final-fields - - public-getters - - private-getters - - public-setters - - private-setters - - constructors - - init-widget-model-method - - init-method - - did-change-dependencies-method - - did-update-widget-method - - on-error-handle-method - - close-method - - dispose-method - - public-methods - - private-methods - widgets-order: - - const-fields - - constructor - - named-constructor - - factory-constructors - - final-fields - - init-state-method - - did-change-dependencies-method - - did-update-widget-method - - dispose-method - - overriden-public-methods - - private-methods - - build-method - - move-records-to-typedefs: - min-fields: 3 - min-occurences: 2 - - move-variable-closer-to-its-usage - - move-variable-outside-iteration - - newline-before-return - - no-boolean-literal-compare - - no-empty-block - - no-equal-arguments: - ignored-parameters: - - height - - width - - no-equal-conditions - - no-equal-nested-conditions - - no-equal-switch-case - - no-equal-switch-expression-cases - - no-equal-then-else - - no-magic-number: - allowed: [-1, 0, 1] - - no-object-declaration - - prefer-addition-subtraction-assignments - - prefer-any-or-every - - prefer-correct-callback-field-name: - name-pattern: ^on[A-Z]+ - - prefer-correct-error-name: - allowed-names: [error, exception, failure] - - prefer-correct-identifier-length: - max-identifier-length: 30 - min-identifier-length: 2 - - prefer-correct-stream-return-type - - prefer-declaring-const-constructor: - ignore-abstract: true - - prefer-early-return: - ignore-if-case: true - - prefer-explicit-function-type - - prefer-explicit-type-arguments - - prefer-immediate-return - - prefer-match-file-name: - exclude: - - "test/**" - - "lib/**/*wm.dart" - - prefer-moving-to-variable: - allowed-duplicated-chains: 3 - - prefer-named-boolean-parameters: - ignore-single: true - ignore-single-boolean: false - - prefer-null-aware-spread - - prefer-parentheses-with-if-null - - prefer-public-exception-classes - - prefer-return-await - - prefer-simpler-patterns-null-check - - prefer-switch-with-enums - - prefer-test-matchers - - prefer-typedefs-for-callbacks - - prefer-unique-test-names - - prefer-wildcard-pattern - # Style - - unnecessary-trailing-comma: false + - avoid-accessing-collections-by-constant-index + - avoid-accessing-other-classes-private-members + - avoid-async-call-in-sync-function + - avoid-barrel-files + - avoid-bottom-type-in-patterns + - avoid-bottom-type-in-records + # https://github.com/dart-lang/sdk/issues/45667 + - avoid-cascade-after-if-null + - avoid-collapsible-if + - avoid-collection-methods-with-unrelated-types + - avoid-declaring-call-method + - avoid-double-slash-imports + - avoid-duplicate-cascades + - avoid-duplicate-collection-elements + - avoid-duplicate-exports + - avoid-duplicate-initializers + - avoid-duplicate-map-keys + - avoid-duplicate-mixins + - avoid-duplicate-named-imports + - avoid-duplicate-patterns + - avoid-duplicate-switch-case-conditions + - avoid-duplicate-test-assertions + - avoid-dynamic + - avoid-equal-expressions + - avoid-explicit-pattern-field-name + - avoid-explicit-type-declaration + - avoid-extensions-on-records + - avoid-function-type-in-records + - avoid-future-tostring + - avoid-generics-shadowing + - avoid-global-state + - avoid-identical-exception-handling-blocks + - avoid-ignoring-return-values + - avoid-inverted-boolean-checks + - avoid-keywords-in-wildcard-pattern + - avoid-local-functions + - avoid-long-files: + max-length: 500 + - avoid-long-functions: + max-length: 80 + ignored-names: + - build + - avoid-long-parameter-list: + ignore-optional: true + max-amount: 5 + ignored-names: + - copyWith + - avoid-long-records: + max-amount: 3 + # https://github.com/dart-lang/sdk/issues/52909 + - avoid-map-keys-contains + - avoid-missed-calls + - avoid-missing-enum-constant-in-map + - avoid-missing-interpolation + - avoid-misused-wildcard-pattern + - avoid-mixing-named-and-positional-fields + - avoid-mutating-parameters + - avoid-negated-conditions + - avoid-nested-conditional-expressions: + acceptable-level: 2 + - avoid-nested-futures + - avoid-nested-records + - avoid-nested-streams-and-futures + - avoid-nested-switch-expressions + - avoid-nested-switches + - avoid-non-null-assertion + - avoid-nullable-interpolation + - avoid-nullable-parameters-with-default-values + - avoid-nullable-tostring + - avoid-one-field-records + - avoid-passing-async-when-sync-expected + - avoid-passing-default-values + - avoid-passing-self-as-argument + - avoid-positional-record-field-access + - avoid-recursive-calls + - avoid-redundant-async + - avoid-redundant-else + - avoid-referencing-discarded-variables + - avoid-self-assignment + - avoid-self-compare + - avoid-shadowed-extension-methods + - avoid-shadowing + - avoid-throw-in-catch-block + - avoid-throw-objects-without-tostring + - avoid-unassigned-late-fields + - avoid-unassigned-stream-subscriptions + - avoid-unconditional-break + - avoid-unnecessary-conditionals + - avoid-unnecessary-futures + - avoid-unnecessary-if + - avoid-unnecessary-local-late + - avoid-unnecessary-negations + - avoid-unnecessary-nullable-return-type + - avoid-unnecessary-return + - avoid-unnecessary-super + - avoid-unsafe-collection-methods + - avoid-unused-after-null-check + - avoid-unused-parameters + - binary-expression-operand-order + - double-literal-format: + explicit-trailing-zero: true + - format-comment: + only-doc-comments: false + - function-always-returns-null + - map-keys-ordering + - match-positional-field-names-on-assignment + - member-ordering: + order: + - public-fields + - private-fields + - private-late-final-fields + - public-getters + - private-getters + - public-setters + - private-setters + - constructors + - init-widget-model-method + - init-method + - did-change-dependencies-method + - did-update-widget-method + - on-error-handle-method + - close-method + - dispose-method + - public-methods + - private-methods + widgets-order: + - const-fields + - final-fields + - constructor + - named-constructor + - factory-constructors + - init-state-method + - did-change-dependencies-method + - did-update-widget-method + - dispose-method + - overriden-public-methods + - private-methods + - build-method + - move-records-to-typedefs: + min-fields: 3 + min-occurences: 2 + - move-variable-closer-to-its-usage + - move-variable-outside-iteration + - newline-before-return + - no-boolean-literal-compare + - no-empty-block + - no-equal-arguments: + ignored-parameters: + - height + - width + - no-equal-conditions + - no-equal-nested-conditions + - no-equal-switch-case + - no-equal-switch-expression-cases + - no-equal-then-else + - no-magic-number: + allowed: [-1, 0, 1] + - no-object-declaration + - prefer-addition-subtraction-assignments + - prefer-any-or-every + - prefer-correct-callback-field-name: + name-pattern: ^on[A-Z]+ + - prefer-correct-error-name: + allowed-names: [error, exception, failure] + - prefer-correct-identifier-length: + max-identifier-length: 30 + min-identifier-length: 2 + - prefer-correct-stream-return-type + - prefer-declaring-const-constructor: + ignore-abstract: true + - prefer-early-return: + ignore-if-case: true + - prefer-explicit-function-type + - prefer-explicit-type-arguments + - prefer-immediate-return + - prefer-match-file-name: + exclude: + - "test/**" + - "lib/**/*wm.dart" + - prefer-moving-to-variable: + allowed-duplicated-chains: 3 + - prefer-named-boolean-parameters: + ignore-single: true + ignore-single-boolean: false + - prefer-null-aware-spread + - prefer-parentheses-with-if-null + - prefer-public-exception-classes + - prefer-return-await + - prefer-simpler-patterns-null-check + - prefer-switch-with-enums + - prefer-test-matchers + - prefer-typedefs-for-callbacks + - prefer-unique-test-names + - prefer-wildcard-pattern + # Style + - unnecessary-trailing-comma: false