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

[FR]: Linter to ensure the use of Assets.images instead of Image.asset(...) #413

Open
2 tasks done
bramp opened this issue Aug 8, 2023 · 0 comments
Open
2 tasks done
Labels
enhancement New feature or request

Comments

@bramp
Copy link
Contributor

bramp commented Aug 8, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

When migrating Image.asset(...) to Assets.images I wanted to ensure all current and future uses were migrated. To avoid regressions, and ensure all contributors to the code base used the same style.

Describe the solution

Having a lint rule would be useful, as such I created one at https://pub.dev/packages/flutter_gen_linter

In your `pubspec.yaml`` add:

dev_dependencies:
  custom_lint: ^0.5.0
  flutter_gen_linter: ^1.0.0

and create a analysis_options.yaml and add:

analyzer:
  plugins:
    - custom_lint

Additional context

Happy for https://pub.dev/packages/flutter_gen_linter to fold into this main project. This was my first Dart Package so I in part wrote it to learn.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bramp bramp added the enhancement New feature or request label Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant