eslint-plugin-strict-pattern-matching
v0.2.0
Published
prevent using non-exhaustive pattern matching in typescript
Maintainers
Readme
eslint-plugin-strict-pattern-matching
prevent using non-exhaustive pattern matching in typescript
Installation
You'll first need to install ESLint:
npm i eslint --save-devNext, install eslint-plugin-strict-pattern-matching:
npm eslint-plugin-strict-pattern-matching --save-devUsage
Add strict-pattern-matching to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"strict-pattern-matching"
]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"strict-pattern-matching/strictPatternMatching": 2
}
}Rules
🔧 Automatically fixable by the --fix CLI option.
| Name | Description | 🔧 | | :----------------------------------------------------------------------------- | :------------------------------------------------------ | :- | | noUnhandledExhaustiveException | no unhandled exhaustive's exception in pattern matching | | | strictPatternMatching | no unexhaustive pattern matching | 🔧 |
