diff --git a/analysis_options.yaml b/analysis_options.yaml index a41a74dafd..76c1fdcda5 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -32,14 +32,22 @@ analyzer: - 'testing/test_package_export_error/**' linter: rules: - - always_declare_return_types - - always_put_required_named_parameters_first - - avoid_bool_literals_in_conditional_expressions - - avoid_unused_constructor_parameters - - directives_ordering - - no_adjacent_strings_in_list - - package_api_docs - - prefer_single_quotes - - sort_child_properties_last - - unawaited_futures - - unnecessary_null_aware_assignments + always_declare_return_types: true + always_put_required_named_parameters_first: true + avoid_bool_literals_in_conditional_expressions: true + avoid_dynamic_calls: true + avoid_single_cascade_in_expression_statements: true + avoid_unused_constructor_parameters: true + avoid_init_to_null: true + directives_ordering: true + no_adjacent_strings_in_list: true + package_api_docs: true + prefer_final_fields: true + prefer_initializing_formals: true + prefer_single_quotes: true + prefer_void_to_null: true + slash_for_doc_comments: true + type_annotate_public_apis: true + # Work in progress canonical score lints + unawaited_futures: true + unnecessary_null_aware_assignments: true diff --git a/analysis_options_presubmit.yaml b/analysis_options_presubmit.yaml index d8a57b0241..ece55a3a9b 100644 --- a/analysis_options_presubmit.yaml +++ b/analysis_options_presubmit.yaml @@ -36,14 +36,22 @@ analyzer: - 'testing/test_package_bad/**' linter: rules: - - always_declare_return_types - - always_put_required_named_parameters_first - - avoid_bool_literals_in_conditional_expressions - - avoid_unused_constructor_parameters - - directives_ordering - - no_adjacent_strings_in_list - - package_api_docs - - prefer_single_quotes - - sort_child_properties_last - - unawaited_futures - - unnecessary_null_aware_assignments + always_declare_return_types: true + always_put_required_named_parameters_first: true + avoid_bool_literals_in_conditional_expressions: true + avoid_dynamic_calls: true + avoid_single_cascade_in_expression_statements: true + avoid_unused_constructor_parameters: true + avoid_init_to_null: true + directives_ordering: true + no_adjacent_strings_in_list: true + package_api_docs: true + prefer_final_fields: true + prefer_initializing_formals: true + prefer_single_quotes: true + prefer_void_to_null: true + slash_for_doc_comments: true + type_annotate_public_apis: true + # Work in progress canonical score lints + unawaited_futures: true + unnecessary_null_aware_assignments: true diff --git a/lib/options.dart b/lib/options.dart index e63d771bc6..01c3f60e8c 100644 --- a/lib/options.dart +++ b/lib/options.dart @@ -41,12 +41,14 @@ class DartdocGeneratorOptionContext extends DartdocOptionContext { String? get relCanonicalPrefix => optionSet['relCanonicalPrefix'].valueAt(context); + /// The 'templatesDir' dartdoc option if one was specified; otherwise `null`. String? get templatesDir => optionSet['templatesDir'].valueAt(context); // TODO(jdkoren): duplicated temporarily so that GeneratorContext is enough for configuration. @override bool get useBaseHref => optionSet['useBaseHref'].valueAt(context); + /// The 'resourcesDir' dartdoc option if one was specified; otherwise `null`. String? get resourcesDir => optionSet['resourcesDir'].valueAt(context); }