Skip to content

Identifier format warnings should give an example #14738

Closed
@chris-morgan

Description

@chris-morgan

People may be confused by warnings that “function 'fooBar' should have a snake case identifier”, e.g. http://stackoverflow.com/questions/24102325/warning-function-should-have-a-snake-case-identifier-on-by-default.

I propose that we alter the message for any of these letter case lints (statics should be uppercase, functions should be snake case, &c.) to give an estimation of the appropriate form based on guessing the form in use and converting it to the desired form. It may not be perfect, but most of the time I think it will be right, and it will make it clearer what the warning is speaking about.

Incidentally, calling it an identifier is something that is likely to confuse beginners; I think it should say that the function should have a snake case name.

function 'fooBar' should have a snake case name such as 'foo_bar'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions