Skip to content

Commit a635200

Browse files
author
Fabien Bézagu
committed
GCI1433[doc]: add examples, limitations and ideas for the next developments
1 parent 60e125b commit a635200

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
@@ -21,18 +21,34 @@ leading to faster execution and improved overall performance.
2121
`format` method.**
2222

2323
```js
24-
// Example with numbro
24+
// Example with numbro (not compliant)
2525
import numbro from "numbro";
2626

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

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

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

3854
### Documentation

0 commit comments

Comments
 (0)