Skip to content

rich-lab/eslint-plugin-financial

Repository files navigation

eslint-plugin-financial

NPM version NPM downloads Node.js CI codecov

Install

npm install eslint-plugin-financial --save-dev

Rules

Usage

Lint javaScript

Configure it in .eslintrc:

{
  "extends": [
    "plugin:financial/recommended"
  ]
}

All the recommended rules will throw errors. If you just want to throw warning, you can configure it as follows:

{
  "plugins": [
    "financial"
  ],
  "rules": {
    "financial/no-float-calculation": "warn",
    "financial/no-division": "warn"
  }
}

Lint TypeScript

You'll need install @typescript-eslint/parser and @typescript-eslint/eslint-plugin first.

npm install @typescript-eslint/parser @typescript-eslint/eslint-plugin -D

Configure it in .eslintrc:

{
  "parser": "@typescript-eslint/parser",
  "extends": [
    "plugin:@typescript-eslint/recommended",
    "plugin:financial/recommended"
  ]
}

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

eslint-plugin-financial © ULIVZ, Released under the MIT License.

About

Awesome ESLint rules for financial scenarios.

Resources

License

Stars

Watchers

Forks

Packages

No packages published