Add faker.location.neighborhood() helper for Brazilian “bairro”
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:
- Selects a prefix from a dedicated array
// neighborhood_prefix.ts export default [ 'Bairro', 'Vila', 'Jardim', 'Residencial', 'Chácara', ]; - Proxies the “name” portion to the existing person generator—just like
street()orcity()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
Source: faker-js/faker