1.0.12 • Published 4 years ago

tslint-mobx v1.0.12

Weekly downloads
53
License
MIT
Repository
github
Last release
4 years ago

tslint-mobx

Lint rules for projects that use MobX.

Usage

First install:

npm install --save-dev tslint-mobx

Then to use the default rules you can add tslint-mobx to extends in your tslint.json:

{
  "extends": ["tslint-mobx"]
}

Rules

  • mobx-react-no-unused-inject
    • Makes sure you don't have any unused injected store.
    • For example if you have @inject('someStore') decorator wrapping your component, but this.props.someStore is unused.
  • mobx-react-no-empty-inject
    • Makes sure you don't have any empty injects (@inject()).
  • mobx-react-no-inject-decorators
    • Makes sure you don't have any inject decorators (@inject()) at all on classes.
  • mobx-react-no-async-action
    • Makes sure you don't have any action decorators (@action) on async methods.

Adding your own rules

Adding your own rules is straightforward.

Add your rule file to the src/rules directory, and your tests to a file with the same name, ending with .spec, in the test directory.

PRs are welcome.

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago