-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Conan edited this page May 5, 2022
·
2 revisions
Scroll down for:
$ pnpm i eslint-plugin-big-number-rules --save-dev
After installation, make the plugin available to your eslint
:
// .eslintrc
{
"plugins": ["big-number-rules"]
}
Recommended rules will warn
about everything:
// .eslintrc
{
"plugins": ["big-number-rules"],
"extends": ["plugin:big-number-rules/recommended"]
}
"Everything" means this:
// .eslintrc
{
"plugins": ["big-number-rules"],
"rules": {
"big-number-rules/arithmetic": "warn",
"big-number-rules/assignment": "warn",
"big-number-rules/isNaN": "warn",
"big-number-rules/math": "warn",
"big-number-rules/number": "warn",
"big-number-rules/parseFloat": "warn",
"big-number-rules/rounding": "warn"
},
"settings": {
"big-number-rules": {
// Specify the following if you want rules to
// apply only to files with this declaration:
//
// import ... from 'bignumber.js'
//
"importDeclaration": "bignumber.js",
// Optionally, you can also apply rules only when
// importing the desired specifier from such
// declarations:
//
// import BigNumber from 'bignumber.js'
//
"importSpecifier": "BigNumber"
}
}
}