most_custom_lints 0.0.4 copy "most_custom_lints: ^0.0.4" to clipboard
most_custom_lints: ^0.0.4 copied to clipboard

Lints rules and corresponding annotations used by Dart/Flutter team at MOST.

example/lib/example.dart

import 'package:most_custom_lints/annotations.dart';

void main() {
  final yearWrapper = YearWrapper(
    yearSince1900: 128,
  );

  print(yearWrapper.getYear());
  print(yearWrapper.yearSince1900);
  print(yearWrapper.year);
  print(yearWrapper.yearText);
  print(yearWrapper.yearTextNew);
}

class YearWrapper {
  @Deprecated('Store the actual year')
  final int yearSince1900;

  YearWrapper({
    required this.yearSince1900,
  });

  @deprecated
  int getYear() => yearSince1900;

  @DeprecatedFrom(
    'All occurences must be replaced with `getYearNew` before Y2K.',
    DeprecationDate(1999, 01, 01),
  )
  String get yearText => yearTextNew;

  @DeprecatedFrom(
    'Must be replaced with `year`',
    DeprecationDate(2050, 01, 01),
  )
  String get yearTextNew => year.toString();

  // ignore: deprecated_member_use_from_same_package
  int get year => (1900 + yearSince1900);
}
6
likes
40
points
1.37k
downloads

Publisher

verified publishermost.io

Weekly Downloads

Lints rules and corresponding annotations used by Dart/Flutter team at MOST.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

analyzer, analyzer_plugin, custom_lint, custom_lint_builder, meta

More

Packages that depend on most_custom_lints