Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

[New rule] Avoid using var #1203

Copy link
Copy link
Open
Open
Copy link
@mdeandrea-mrmilu

Description

@mdeandrea-mrmilu
Issue body actions

Rule details

This rule should show warning when use var on code.
The style guide for Flutter indicate to avoid using var on code, so that will be a nice rule to have

What type of rule is this?

Warns about a potential problem

Example code

BAD:

var x = 10; // LINT

String concat(int a, int b) {
  var c = 3; // LINT
  return a + b + c;
}

GOOD:

int x = 10;

final x = 10;

String concat(int a, int b) {
  int c = 3; // or final c = 3;
  return a + b + c;
}

Participation

  • I am willing to submit a pull request to implement this rule.

Additional comments

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.