Skip to content

Commit 634590d

Browse files
author
Fabien Bézagu
committed
GCI535[doc]: add examples, limitations and ideas for the next developments
1 parent 380bee5 commit 634590d

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

eslint-plugin/docs/rules/no-imported-number-format-library.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,34 @@ leading to faster execution and improved overall performance.
1919
`format` method.**
2020

2121
```js
22-
// Example with numbro
22+
// Example with numbro (not compliant)
2323
import numbro from "numbro";
2424

2525
numbro.setLanguage('en-GB');
2626
var string = numbro(1000).format({
2727
thousandSeparated: true,
2828
}); // '1,000'
2929

30-
// Example with Intl
30+
// Example with numerable (not compliant)
31+
import { format } from "numerable";
32+
format(1000, '0,0');
33+
34+
// Example with Intl (compliant)
3135
new Intl.NumberFormat("en-GB").format(1000); // '1,000'
3236
```
3337

38+
## Limitations
39+
As for now, only two libraries are handled by this rule :
40+
- [numbro](https://numbrojs.com/)
41+
- [numerable](https://numerablejs.com/lander)
42+
43+
Some candidates for the future developments are :
44+
- [javascript-number-formatter](https://github.com/Mottie/javascript-number-formatter)
45+
- [numeraljs](https://www.npmjs.com/package/numerable)
46+
- [formatjs](https://formatjs.github.io/)
47+
48+
It’s more likely this rule won’t ever be exhaustive.
49+
3450
## Resources
3551

3652
### Documentation

0 commit comments

Comments
 (0)