Fix eslint errors#3374
Conversation
| const text = this.state.text; | ||
| this.setState({ | ||
| preview: markdown.toHTML(this.state.text), | ||
| preview: markdown.toHTML(text), |
There was a problem hiding this comment.
react/no-access-state-in-setstate
| } | ||
|
|
||
| init.init = true; | ||
|
|
There was a problem hiding this comment.
Ah, I just noticed that this directive is not used anymore (checked twice 😄), so decided to remove it instead of fixing eslint warnings there.
ranbena
left a comment
There was a problem hiding this comment.
One question about the removal of client/app/components/transclude-replace.js - is it related to this PR?
If so, go ahead and merge before anyone else.
|
|
||
| setActionInProgress = (actionName, inProgress) => { | ||
| this.setState({ | ||
| this.setState(prevState => ({ |
There was a problem hiding this comment.
Cool, I didn't know prevState existed here 😅
There was a problem hiding this comment.
Me too. I just read the docs 😄
There was a problem hiding this comment.
BTW - it's the same warning as @ranbena mentioned above - react/no-access-state-in-setstate
There was a problem hiding this comment.
Also, eslint is smart enough to detect code like this (the same rule):
updateCounter() {
const counter = this.state.counter + 1;
this.setState({ counter });
}(I tried to modify code this way, but warning didn't disappear 😅)
Mostly just removed extra empty lines at EoF.
@ranbena and @gabrieldutra There are also some fixes to components you were recently working on, so please check it. Thanks!