Skip to content

Commit

Permalink
Rule 'no-anonymous-observer' is deprecated. Removed from recommended,… (
Browse files Browse the repository at this point in the history
  • Loading branch information
kazah96 authored Jun 10, 2022
1 parent 45e3642 commit 09a8fe4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
17 changes: 16 additions & 1 deletion packages/eslint-plugin-mobx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,22 @@ It's a bit opinionated and can lead to a lot of false positives depending on you
]
```

### mobx/no-anonymous-observer
### mobx/no-anonymous-observer (deprecated)

_Deprecated in favor of [react/display-name](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md) + [componentWrapperFunctions](https://github.com/jsx-eslint/eslint-plugin-react). Example of **.eslintrc**:_
```
{
"rules": {
"react/display-name": "warn"
},
"settings": {
"componentWrapperFunctions": [
"observer"
]
}
}
```
---

Forbids anonymous functions or classes as `observer` components.
Improves debugging experience and [avoids problem with inability to customize `displayName`](https://github.com/mobxjs/mobx/issues/2721).
Expand Down
3 changes: 1 addition & 2 deletions packages/eslint-plugin-mobx/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ module.exports = {
"mobx/exhaustive-make-observable": "warn",
"mobx/unconditional-make-observable": "error",
"mobx/missing-make-observable": "error",
"mobx/missing-observer": "warn",
"mobx/no-anonymous-observer": "warn"
"mobx/missing-observer": "warn"
}
}
},
Expand Down

0 comments on commit 09a8fe4

Please sign in to comment.