Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/eslint standarjs conflicts on generator functions #1523

Merged

Conversation

lzhuor
Copy link
Contributor

@lzhuor lzhuor commented Mar 12, 2019

Description

Standard JS requires spacing before and after * of a generator function.
image

We could fix this error using auto fix with ESLint's editor plugin (I'm on WebStorm). However, the space will be removed during pre-commit phase (lint-staged) and then editor will show lint error again. It becomes cyclic.

Change Type

Please enter one or more of the following:

  • Other (eslint configuration)

Testing Steps

  1. Fix spacing before and after * for generator functions
  2. Commit and push code
  3. There should be no errors about generator-star-spacing. The spacing added in step 1 should remain in code.

Code Checklist

  • Code compiles successfully (verified via yarn start)
  • README.md and other documentation is updated as needed

Fix #1522

.eslintrc Outdated Show resolved Hide resolved
@schnogz
Copy link
Contributor

schnogz commented Mar 12, 2019

Also run yarn prettier && yarn lint:fix to apply rules to all files and commit those changes as well.

@lzhuor
Copy link
Contributor Author

lzhuor commented Mar 12, 2019

@schnogz thanks! Addressed comments and pushed them.

Copy link
Contributor

@schnogz schnogz left a comment

Choose a reason for hiding this comment

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

i see we have a warning when running lint tasks: Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration .

Can you add a settings object to .eslintrc to fix this warning. Add the following snippet and the warning will go away.

"settings": {
    "react": {
      "version": "latest"
    }
  },

@lzhuor
Copy link
Contributor Author

lzhuor commented Mar 12, 2019

@schnogz , Could you please share which command generates that warning? Is it on circleci or local? It seems fine on my local. I have tried yarn lint, yarn lint:fix and yarn:frontend.

@lzhuor
Copy link
Contributor Author

lzhuor commented Mar 12, 2019

@schnogz Added. Thanks!

@schnogz schnogz merged commit 47eeafa into blockchain:development Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eslint and Standard JS conflicts about generator functions
2 participants