prefer_shorthands 0.4.7 copy "prefer_shorthands: ^0.4.7" to clipboard
prefer_shorthands: ^0.4.7 copied to clipboard

An analyzer plugin that suggests using Dart's dot shorthand syntax.

prefer_shorthands #

pub package

Linter and Quick-fix. Enjoy it! ✨

⚠️ Warning: There may be some missing cases and other unknown issues. Welcome to report an issue.

Usage #

To use this analyzer plugin, add it to your analysis_options.yaml file at the root of your Dart or Flutter project:

plugins:
  prefer_shorthands: ^0.4.7

After adding the plugin, restart the Dart Analysis Server (in VS Code: press Cmd+Shift+P and select "Dart: Restart Analysis Server", or in IntelliJ/Android Studio: click the "Restart Dart Analysis Server" button in the toolbar).

Settings #

Add like this in your project analysis_options.yaml:

prefer_shorthands:
  convert_implicit_declaration: true
Paramenter Default Value Warning Code Fix Result
convert_implicit_declaration false final a = String.fromCharCode(96); final String a = .fromCharCode(96);

Learn More #

To learn more about Dart's dot shorthand syntax, check out the official documentation: Dot shorthands - Dart

Feedback #

If you encounter any issues while using this package, please feel free to report them on GitHub Issues.

3
likes
150
points
285
downloads

Publisher

verified publishernysm.dev

Weekly Downloads

An analyzer plugin that suggests using Dart's dot shorthand syntax.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

analysis_server_plugin, analyzer, analyzer_plugin, meta, yaml

More

Packages that depend on prefer_shorthands