json_serializable_lints 0.2.1 copy "json_serializable_lints: ^0.2.1" to clipboard
json_serializable_lints: ^0.2.1 copied to clipboard

Dart custom lint rules for json_serializable package.

example/example.md

Examples #

Usage #

Add the package to your Dart or Flutter project:

# analysis_options.yaml
plugins:
  json_serializable_lints: any

Run analysis:

dart analyze

Ignoring rules #

Ignore a single violation:

// ignore: require_json_serializable_to_json
@JsonSerializable()
class LegacyUser {
  LegacyUser();

  factory LegacyUser.fromJson(Map<String, dynamic> json) => LegacyUser();
}

Ignore for a whole file:

// ignore_for_file: require_json_serializable_from_json, require_json_serializable_to_json