{"repo":"shuckster/eslint-plugin-big-number-rules","free":true,"listed":false,"github":"https://github.com/shuckster/eslint-plugin-big-number-rules","clone":"git clone https://github.com/shuckster/eslint-plugin-big-number-rules.git","description":"Enforce (or automatically fix) finance-safe calculations using BigNumber or similar libraries.","language":"JavaScript","stars":17,"topics":["eslint-plugin","arithmetic","bignumber","finance"],"license":"MIT","category":"trading","readme_excerpt":"eslint-plugin- big-number-rules 🔢 ✊ Enforce 💰 finance-safe 🧷 calculations using bignumber.js (or something similar!) instead of native JavaScript arithmetic and Math functions. - Customisable! - Noisy! - Finance-safe? Configuration After installation, make the plugin available to your eslint : Recommended rules will warn about everything: Flat config (ESLint 9+) \"Everything\" means this: You can also customise the transformations. Example transforms: from to plugin will also suggest -------------------------- ------------------------------------ ----------------------------------------------------------------------------------------------------------------- 0.1 + 0.2 BigNumber.sum(0.1, 0.2) ('').concat(0.1, 0.2) and ${0.1}${0.2} when you want string-concatenation instead of financial arithmetic result === 0.3 BigNumber(result).isEqualTo(0.3) Object.is(result, 0.3) when you want to strictly compare things that are not financial calculations 19.99 0.1 BigNumber(19.99).multipliedBy(0.1) 1 4 BigNumber(2).shiftedBy(4) 4 👋 Note: Since v2.2.0 I hope you will be less inclined to use this setting because detection of concat operations on string-literals is improved. Credits eslint-plugin-big-number-rules was written by Conan Theobald. He was inspired by the work of these fine Internet folk: - bignumber.js :) - eslint-plugin-bignumber - eslint-plugin-arithmetic - AST Explorer 🙏 Contributing If you'd like to offer a material contribution, I like coffee ☕️ :) License MIT licensed: Se","default_branch":null,"files":null,"tree":[],"storefront":"/r/shuckster","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/shuckster/eslint-plugin-big-number-rules/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}