Skip to content

Axios should warn about options like baseURL being misspelled baseUrl #6488

@cincodenada

Description

@cincodenada

Is your feature request related to a problem? Please describe.

I wasted half an hour today trying to figure out why my base URL wasn't being respected, before I realized that I had spelled it baseUrl instead of baseURL. Axios silently ignored my parameter - given that Axios is liberal about accepting unknown options, I'm sure I'm not the first to trip over this and waste time on a silly ambiguity in the application of camelCase.

Any solutions here should also be applied to options such as withXSRFToken, ideally in an automated way so that any new options with ambiguous camelCase representations would be automatically included.

Describe the solution you'd like

I would love if Axios simply accepted baseUrl as an optional spelling of baseURL, since Axios is already being liberal in what it accepts, and the intent is clear.

Describe alternatives you've considered

At the very least, I think it should log a warning - something like "baseUrl is likely a misspelling of baseURL" - to help point folks in the right direction.

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