forked from solid-software/solid_lints
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored code for
ignored_types
type matching using AST analyzer (s…
- Loading branch information
Showing
5 changed files
with
154 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
lint_test/avoid_late_keyword_allow_no_type_specified/analysis_options.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
analyzer: | ||
plugins: | ||
- ../custom_lint | ||
|
||
custom_lint: | ||
rules: | ||
- avoid_late_keyword: | ||
allow_initialized: false | ||
ignored_types: | ||
- Subscription |
34 changes: 34 additions & 0 deletions
34
...void_late_keyword_allow_no_type_specified/avoid_late_keyword_allow_no_type_specified.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// ignore_for_file: prefer_const_declarations, unused_local_variable, prefer_match_file_name | ||
// ignore_for_file: avoid_global_state | ||
|
||
class Subscription<T> {} | ||
|
||
class ConcreteTypeWithNoGenerics {} | ||
|
||
/// Check "late" keyword fail | ||
/// | ||
/// `avoid_late_keyword` | ||
/// allow_initialized option enabled | ||
class AvoidLateKeyword { | ||
late final Subscription subscription1; | ||
|
||
late final Subscription<ConcreteTypeWithNoGenerics> subscription2; | ||
|
||
late final Subscription<List<int>> subscription3; | ||
|
||
late final Subscription<List<List<int>>> subscription4; | ||
|
||
late final Subscription<Map<dynamic, String>> subscription5; | ||
|
||
void test() { | ||
late final Subscription subscription1; | ||
|
||
late final Subscription<ConcreteTypeWithNoGenerics> subscription2; | ||
|
||
late final Subscription<List<int>> subscription3; | ||
|
||
late final Subscription<List<List<int>>> subscription4; | ||
|
||
late final Subscription<Map<dynamic, String>> subscription5; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters