Skip to main content

no-object-declaration

added in: 1.0.0 style

Warns when a class member is declared with Object type.

Example

Bad:

class Test {
Object data = 1; // LINT

Object get getter => 1; // LINT

// LINT
Object doWork() {
return;
}
}

Good:

class Test {
int data = 1;

int get getter => 1;

void doWork() {
return;
}
}