Skip to content

Add faker.location.neighborhood() helper for Brazilian “bairro” #3494

@glmchalita

Description

@glmchalita

Clear and concise description of the problem

Currently, FakerJS doesn’t include a built-in way to generate Brazilian “bairros” (neighborhoods), so some people have been using faker.location.county() as a workaround. Since “counties” usually refer to larger regions (e.g. in the US or UK), the results don’t always match the smaller, city-level nature of a Brazilian bairro.

As a developer working with the pt_BR locale in FakerJS, I’d love to see a dedicated faker.location.neighborhood() (or bairro()) method so that my generated addresses feel more authentic and align with local conventions.

Suggested solution

Add a new neighborhood() method in the location module that:

  1. Selects a prefix from a dedicated array
    // neighborhood_prefix.ts
    export default [
      'Bairro',
      'Vila',
      'Jardim',
      'Residencial',
      'Chácara',
    ];
  2. Proxies the “name” portion to the existing person generator—just like street() or city() use other modules—to get a plausible, randomized core name:
    // neighborhood_pattern.ts
     export default [
       '{{location.neighborhood_prefix}}{{person.firstName}}',
       '{{location.neighborhood_prefix}}{{person.last_name.generic}}',
     ];

Alternative

Overload faker.location.county() to return Brazilian bairros in pt_BR only, but this is semantically confusing for users.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions