Skip to main content

incorrect-firebase-event-name

added in: 1.21.0
Pro+

Warns when the event name does not comply with Firebase limitations.

Firebase requires the event name to contain 1 to 40 alphanumeric characters or underscores and start with an alphabetic character.

Example

❌ Bad:

void fn() {
// LINT: Incorrect event name. Event names should contain 1 to 40 alphanumeric characters or underscores and start with an alphabetic character.
_analytics.logEvent(name: '');

// LINT: Incorrect event name. Event names should contain 1 to 40 alphanumeric characters or underscores and start with an alphabetic character.
_analytics.logEvent(name: '😅');

// LINT: Incorrect event name. Event names should contain 1 to 40 alphanumeric characters or underscores and start with an alphabetic character.
_analytics.logEvent(name: '_');
}

✅ Good:

void fn() {
_analytics.logEvent(name: 'correct_name');
}

Additional Resources