Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit 841f07a

Browse files
committed
remove the 'library_names' lint
1 parent df9bcbf commit 841f07a

File tree

5 files changed

+25
-16
lines changed

5 files changed

+25
-16
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
- added `library_annotations` (https://github.com/dart-lang/lints/issues/177)
55
- added `no_wildcard_variable_uses` (https://github.com/dart-lang/lints/issues/139)
66
- removed `package_prefixed_library_names` (https://github.com/dart-lang/lints/issues/172)
7+
- `recommended`:
8+
- removed `library_names` (https://github.com/dart-lang/lints/issues/181)
79
- Updated the SDK lower-bound to 3.1.
810
- Add a section on upgrading to the latest lint set to the readme.
911

lib/recommended.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ linter:
2525
- empty_statements
2626
- exhaustive_cases
2727
- implementation_imports
28-
- library_names
2928
- library_prefixes
3029
- library_private_types_in_public_api
3130
- no_leading_underscores_for_library_prefixes

rules.md

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
| [`empty_statements`](https://dart.dev/lints/empty_statements) | Avoid empty statements. ||
6060
| [`exhaustive_cases`](https://dart.dev/lints/exhaustive_cases) | Define case clauses for all constants in enum-like classes. ||
6161
| [`implementation_imports`](https://dart.dev/lints/implementation_imports) | Don't import implementation files from another package. | |
62-
| [`library_names`](https://dart.dev/lints/library_names) | Name libraries using `lowercase_with_underscores`. | |
6362
| [`library_prefixes`](https://dart.dev/lints/library_prefixes) | Use `lowercase_with_underscores` when specifying a library prefix. | |
6463
| [`library_private_types_in_public_api`](https://dart.dev/lints/library_private_types_in_public_api) | Avoid using private types in public APIs. | |
6564
| [`no_leading_underscores_for_library_prefixes`](https://dart.dev/lints/no_leading_underscores_for_library_prefixes) | Avoid leading underscores for library prefixes. ||

tool/gen_docs.dart

+2-8
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,8 @@ String _createRuleTable(
9090
final ruleMeta =
9191
lintMeta.firstWhereOrNull((meta) => meta['name'] == rule);
9292

93-
if (ruleMeta == null) {
94-
print('rules.json data for rule \'$rule\' not found.');
95-
print('Update lib/rules.json from '
96-
'https://raw.githubusercontent.com/dart-lang/site-www/main/src/_data/linter_rules.json.');
97-
exit(1);
98-
}
99-
final description = ruleMeta['description'] as String?;
100-
final hasFix = ruleMeta['fixStatus'] == 'hasFix';
93+
final description = ruleMeta?['description'] as String? ?? '';
94+
final hasFix = ruleMeta?['fixStatus'] == 'hasFix';
10195
final fixDesc = hasFix ? '✅' : '';
10296

10397
return '| [`$rule`](https://dart.dev/lints/$rule) | $description | $fixDesc |';

tool/rules.json

+21-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
{
2828
"name": "avoid_returning_null_for_future",
2929
"description": "Avoid returning null for Future.",
30-
"fixStatus": "hasFix"
30+
"fixStatus": "noFix"
3131
},
3232
{
3333
"name": "avoid_slow_async_io",
@@ -72,7 +72,7 @@
7272
{
7373
"name": "comment_references",
7474
"description": "Only reference in scope identifiers in doc comments.",
75-
"fixStatus": "noFix"
75+
"fixStatus": "hasFix"
7676
},
7777
{
7878
"name": "control_flow_in_finally",
@@ -82,7 +82,7 @@
8282
{
8383
"name": "deprecated_member_use_from_same_package",
8484
"description": "Avoid using deprecated elements from within the package in which they are declared.",
85-
"fixStatus": "needsFix"
85+
"fixStatus": "hasFix"
8686
},
8787
{
8888
"name": "diagnostic_describe_all_properties",
@@ -134,6 +134,11 @@
134134
"description": "Boolean expression composed only with literals.",
135135
"fixStatus": "noFix"
136136
},
137+
{
138+
"name": "missing_code_block_language_in_doc_comment",
139+
"description": "A code block is missing a specified language.",
140+
"fixStatus": "needsEvaluation"
141+
},
137142
{
138143
"name": "no_adjacent_strings_in_list",
139144
"description": "Don't use adjacent strings in list.",
@@ -179,6 +184,11 @@
179184
"description": "Avoid `throw` in finally block.",
180185
"fixStatus": "noFix"
181186
},
187+
{
188+
"name": "unintended_html_in_doc_comment",
189+
"description": "Use of angle brackets in a doc comment is treated as HTML by Markdown.",
190+
"fixStatus": "needsEvaluation"
191+
},
182192
{
183193
"name": "unnecessary_statements",
184194
"description": "Avoid using unnecessary statements.",
@@ -247,7 +257,7 @@
247257
{
248258
"name": "always_require_non_null_named_parameters",
249259
"description": "Specify `@required` on named parameters without defaults.",
250-
"fixStatus": "hasFix"
260+
"fixStatus": "noFix"
251261
},
252262
{
253263
"name": "always_specify_types",
@@ -522,7 +532,7 @@
522532
{
523533
"name": "flutter_style_todos",
524534
"description": "Use Flutter TODO format: // TODO(username): message, https://URL-to-issue.",
525-
"fixStatus": "noFix"
535+
"fixStatus": "hasFix"
526536
},
527537
{
528538
"name": "implementation_imports",
@@ -871,7 +881,7 @@
871881
},
872882
{
873883
"name": "require_trailing_commas",
874-
"description": "Use trailing commas for all function calls and declarations.",
884+
"description": "Use trailing commas for all parameter lists and argument lists.",
875885
"fixStatus": "hasFix"
876886
},
877887
{
@@ -984,6 +994,11 @@
984994
"description": "Avoid library directives unless they have documentation comments or annotations.",
985995
"fixStatus": "hasFix"
986996
},
997+
{
998+
"name": "unnecessary_library_name",
999+
"description": "Don't have a library name in a `library` declaration.",
1000+
"fixStatus": "hasFix"
1001+
},
9871002
{
9881003
"name": "unnecessary_new",
9891004
"description": "Unnecessary new keyword.",

0 commit comments

Comments
 (0)