Skip to main content

incorrect-firebase-parameter-name

added in: 1.21.0
Pro+

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

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

Example

❌ Bad:

void fn() {
_analytics.logEvent(name: '', parameters: {
// LINT: Incorrect parameter name. Parameter names should contain 1 to 40 alphanumeric characters or underscores and start with an alphabetic character.
'some-name': 'str',

// LINT: Incorrect parameter name. Parameter names should contain 1 to 40 alphanumeric characters or underscores and start with an alphabetic character.
'': 'str',
});
}

✅ Good:

void fn() {
_analytics.logEvent(name: '', parameters: {
'some_name': 'str',
});

_analytics.logSignUp(signUpMethod: '', parameters: {
'correct_param': 'str',
});
}

Additional Resources