Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(neon_lints): update lints #2526

Merged
merged 1 commit into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/cookie_store/lib/src/storable_cookie.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Upstream bug: https://github.com/dart-lang/linter/issues/5065
// ignore_for_file: unintended_html_in_doc_comment

import 'package:meta/meta.dart';
import 'package:timezone/timezone.dart' as tz;

Expand Down
4 changes: 2 additions & 2 deletions packages/neon_framework/lib/src/bloc/result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class Result<T> {
///
/// This can be false even when the asynchronous computation has completed
/// successfully, if the computation did not return a non-null value. For
/// example, a [Future<void>] will complete with the null value even if it
/// example, a `Future<void>` will complete with the null value even if it
/// completes successfully.
/// A result may both have an error and data.
bool get hasData => data != null;
Expand Down Expand Up @@ -180,7 +180,7 @@ class Result<T> {
typedef ResultWidgetBuilder<T> = Widget Function(BuildContext context, Result<T> snapshot);

/// Widget that builds itself based on the latest snapshot of interaction with
/// a [Stream<Result>].
/// a `Stream<Result>`.
///
/// Widget rebuilding is scheduled by each interaction, using [State.setState],
/// but is otherwise decoupled from the timing of the stream. The [builder]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ abstract interface class Exportable {

/// Serialization helpers for a collection of [Option]s.
extension SerializeOptions on Iterable<Option<dynamic>> {
/// Serializes into an [Iterable<JsonEntry>].
/// Serializes into an `Iterable<JsonEntry>`.
///
/// Use [Map.fromEntries] to get a json Map.
Iterable<MapEntry<String, Object?>> serialize() sync* {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final _log = Logger('Option');
/// Listenable option that is persisted in the [SettingsStore].
///
/// See:
/// * [ToggleOption] for an Option<bool>
/// * [ToggleOption] for an `Option<bool>`
/// * [SelectOption] for an Option with multiple values
sealed class Option<T> extends ChangeNotifier implements ValueListenable<T>, Disposable {
/// Creates an Option
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SettingsExportHelper {
/// Imports the [json] data and applies the stored [Option]s.
///
/// See:
/// * [applyFromFile] to import data from a [Stream<Uint8List>].
/// * [applyFromFile] to import data from a `Stream<Uint8List>`.
Future<void> applyFromJson(Map<String, Object?> json) async {
for (final exportable in exportables) {
await exportable.import(json);
Expand Down
2 changes: 1 addition & 1 deletion packages/neon_framework/lib/src/theme/icons.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: non_constant_identifier_names, unintended_html_in_doc_comment

import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
Expand Down
4 changes: 4 additions & 0 deletions packages/neon_lints/lib/src/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ linter:
directives_ordering: true
discarded_futures: true
do_not_use_environment: true
document_ignores: false
empty_catches: true
empty_constructor_bodies: true
empty_statements: true
eol_at_end_of_file: true
erase_dart_type_extension_types: true
exhaustive_cases: true
file_names: true
flutter_style_todos: true
Expand All @@ -87,6 +89,7 @@ linter:
implicit_call_tearoffs: true
implicit_reopen: true
invalid_case_patterns: true
invalid_runtime_check_with_js_interop_types: true
join_return_with_assignment: true
leading_newlines_in_multiline_strings: true
library_annotations: true
Expand Down Expand Up @@ -178,6 +181,7 @@ linter:
type_init_formals: true
type_literal_in_constant_pattern: true
unawaited_futures: true
unintended_html_in_doc_comment: true
unnecessary_await_in_return: true
unnecessary_brace_in_string_interps: true
unnecessary_breaks: true
Expand Down
5 changes: 3 additions & 2 deletions packages/neon_lints/lint_maker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ base:
avoid_as: false
avoid_catches_without_on_clauses: false
diagnostic_describe_all_properties: false
document_ignores: false
provokateurin marked this conversation as resolved.
Show resolved Hide resolved
lines_longer_than_80_chars: false
no_default_cases: false
one_member_abstracts: false
prefer_double_quotes: false
prefer_expression_function_bodies: false
prefer_final_parameters: false
prefer_relative_imports: false
unnecessary_final: false
prefer_final_parameters: false
prefer_expression_function_bodies: false