eslint / config-inspector

A visual tool for inspecting and understanding your ESLint flat configs.
https://www.npmjs.com/package/@eslint/config-inspector
Apache License 2.0
730 stars 19 forks source link

`nth` function breaks on large numbers, causing inconsistencies #74

Closed pauliesnug closed 3 months ago

pauliesnug commented 4 months ago

the current implementation of nth is as follows:

export function nth(n: number) {
  if (n === 1)
    return '1st'
  if (n === 2)
    return '2nd'
  if (n === 3)
    return '3rd'
  return `${n}th`
}

this leads to issues like this: image

i can submit a PR to fix this if needed. maybe we use a small devdepencency library?

voxpelli commented 3 months ago

Agree, made a PR to fix 👍