Files
sdk/pkg/analysis_server/analysis_options.yaml
T
Paul Berry 07669ab650 [messages] Remove HintCode.deprecatedMemberUseFromSamePackage*.
Removes the diagnostic codes
`HintCode.deprecatedMemberUseFromSamePackage` and
`HintCode.deprecatedMemberUseFromSamePackageWithMessage`, and the
logic for reporting them. These hint codes have been replaced with
lints.

Removing these diagnostic codes avoids an ambiguity between
`HintCode.deprecatedMemberUseFromSamePackageWithMessage` and
`LinterLintCode.deprecatedMemberUseFromSamePackageWithMessage`.

Avoiding ambiguities like these is important, because in many cases
the user only sees the diagnostic name; they don't see the class it's
in. For example, `ignore:` comments just give the diagnostic name, and
the web page https://dart.dev/tools/diagnostics only shows diagnostic
names.

In the future I intend to add an error check to the analyzer
diagnostic code generator, to ensure that there are no ambiguities
like these. This CL is a prerequisite for adding the error check.

To avoid this change causing `ignore:` comments to become unnecessary
(which would break bots), I've enabled the lint
`deprecated_member_use_from_same_package` in `pkg/analysis_server`,
`pkg/analyzer`, `pkg/compiler`, and `pkg/linter`. After this change
lands, I will work with the owners of those packages to determine
whether it's better to keep the lint enabled or to remove the
`ignore:` comments.

Change-Id: I6a6a6964aa7f69a41b9b815e0f50fc638898f104
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/455541
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-10-20 06:49:30 -07:00

42 lines
1.3 KiB
YAML

include: package:lints/recommended.yaml
analyzer:
language:
strict-casts: true
strict-raw-types: true
errors:
# Increase the severity of the unused_import hint.
unused_import: warning
# Lints from the recommended set that conflict w/ analyzer style or will
# require some work to reach compliance.
# See: https://github.com/dart-lang/sdk/issues/48785
# A fair amount of lib/ code (especially protocol-related code) does not
# comply.
constant_identifier_names: ignore
# This package imports much of the implementation libraries of the
# 'analyzer' (and sometimes the '_fe_analyzer_shared' package), because it
# is tightly integrated. This will not likely change any time soon.
implementation_imports: ignore
overridden_fields: ignore
todo: ignore
linter:
rules:
- avoid_bool_literals_in_conditional_expressions
- avoid_redundant_argument_values
- deprecated_member_use_from_same_package
- flutter_style_todos
- no_literal_bool_comparisons
- prefer_single_quotes
- unawaited_futures
- unnecessary_async
- unnecessary_breaks
- unnecessary_final
- unnecessary_ignore
- unnecessary_library_directive
- unnecessary_parenthesis
- unreachable_from_main
- use_null_aware_elements