Skip to content

Consistent formatting of examples (return values) #3335

Open
@ST-DDT

Description

@ST-DDT

Continuation of #3287


The examples are inconsistently formatted, both in our source code and when running the refresh on the website.

  • string without quotes:
    * faker.finance.accountNumber() // 92842238
    * faker.finance.accountNumber(5) // 28736
    * faker.finance.accountNumber({ length: 5 }) // 32564
  • single line string newline:
    * faker.finance.transactionDescription()
    * // 'payment transaction at Emard LLC using card ending with ****9187 for HNL 506.57 in account ***2584.'
  • single line string inline:
    * faker.food.description() // 'An exquisite ostrich roast, infused with the essence of longan, slow-roasted to bring out its natural flavors and served with a side of creamy red cabbage'
  • array without leading/ending space:
    * faker.helpers.objectEntry({ prop1: 'value1', prop2: 'value2' }) // ['prop1', 'value1']
  • array with leading/ending space:
    * faker.helpers.shuffle(['a', 'b', 'c']) // [ 'b', 'c', 'a' ]

Also some examples seem to refer to old parameter defaults or locale data as well.

We should define a function that formats our examples consistently.
Potentially automatically via script.

Metadata

Metadata

Assignees

Labels

c: docsImprovements or additions to documentationp: 1-normalNothing urgent

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions