Skip to content

Fix eslint errors#3374

Merged
kravets-levko merged 4 commits into
getredash:masterfrom
kravets-levko:fix-eslint-errors
Jan 31, 2019
Merged

Fix eslint errors#3374
kravets-levko merged 4 commits into
getredash:masterfrom
kravets-levko:fix-eslint-errors

Conversation

@kravets-levko

Copy link
Copy Markdown
Collaborator

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!

const text = this.state.text;
this.setState({
preview: markdown.toHTML(this.state.text),
preview: markdown.toHTML(text),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What lint error is this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

react/no-access-state-in-setstate

Comment thread client/.eslintrc.js
}

init.init = true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ranbena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 => ({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I didn't know prevState existed here 😅

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me too. I just read the docs 😄

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW - it's the same warning as @ranbena mentioned above - react/no-access-state-in-setstate

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😅)

Comment thread client/app/components/tags-control/TagsControl.jsx Outdated
@kravets-levko
kravets-levko merged commit 3d58860 into getredash:master Jan 31, 2019
@ghost ghost removed the in progress label Jan 31, 2019
@kravets-levko
kravets-levko deleted the fix-eslint-errors branch January 31, 2019 12:33
@pr-triage pr-triage Bot added the PR: merged label Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants