FEDX-530: Remove sdk_version_<language_feature>
rules
#200
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On older versions of Dart (early days of 2.x), the process around introducing new language features wasn't as mature as it is today. If you used a language feature without raising the SDK minimum for your package to the appropriate version, you'd get a diagnostic from the analyzer but it wasn't an error. So, this package promoted those diagnostics to errors to ensure that you wouldn't miss them.
Here are the rules that we configured:
sdk_version_async_exported_from_core
sdk_version_as_expression_in_const_context
sdk_version_bool_operator_in_const_context
sdk_version_eq_eq_operator_in_const_context
sdk_version_extension_methods
sdk_version_is_expression_in_const_context
sdk_version_set_literal
sdk_version_ui_as_code
sdk_version_ui_as_code_in_const_context
Dart 3.2.0 was just released and dropped support for those diagnostics, meaning that any package with an
analysis_options.yaml
that includes those rules would receive a warning from the analyzer like this:For the diagnostics listed above, the corresponding language features have been supported since Dart 2.6 or earlier. This package already specifies a minimum SDK version of 2.12.0, so there's no need to include these rules any longer.