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

feat(internals): Add prettier integration #2095

Closed
wants to merge 5 commits into from

Conversation

blling
Copy link

@blling blling commented Jan 7, 2018

JG: resolves #1945

Replace #2083

This PR complete the following task:

  • Add prettier integration.

@azz's suggestions:
Use the plugin:prettier/recommended ESLint config: https://github.com/prettier/eslint-plugin-prettier#recommended-configuration
$ yarn add --dev eslint-plugin-prettier eslint-config-prettier

// .eslintrc.json
"extends": ["plugin:prettier/recommended"],

And just add one custom option now:

"prettier": {
  "singleQuote": true
},

And add lint-stage as follows:

  "lint-staged": {
    "*.js": [
      "prettier --write",
      "lint:eslint",
      "stylelint",
      "git add"
    ]
  },

git add in the lint-stage will add the correct file:)

  • Run prettier on the entire codebase and fix problems after run prettier.

Two main changes:

  1. Add stylelint rules:
    "rules": {
      "rule-empty-line-before": null,
      "declaration-block-semicolon-newline-after": null
    }
  1. Replace eslint-disable-line to eslint-disable-next-line in some special lines.
  • Fix generate CI failure.

Add prettier action for plop, in order to format the js file after generated.

@coveralls
Copy link

coveralls commented Jan 11, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling aa76bab on blling:prettier-2 into e931dd6 on react-boilerplate:dev.

@react-boilerplate react-boilerplate deleted a comment from coveralls Jan 16, 2018
@react-boilerplate react-boilerplate deleted a comment from coveralls Jan 16, 2018
@gretzky
Copy link
Member

gretzky commented Jan 17, 2018

@blling can you resolve the conflicts here?

@blling
Copy link
Author

blling commented Jan 19, 2018

@gretzky If #2113 merged, the conflicts will go away, I will wait for #2113 :)
Other maintaners seems very busy 😞

@blling
Copy link
Author

blling commented Jun 24, 2018

Prettier is aready land on master, so i close it. Thanks @julienben .

@blling blling closed this Jun 24, 2018
@julienben
Copy link
Member

@blling Sorry I didn't cherry pick from this branch. I tried it but it became messy with the other changes in the v3.6 branch.

Also, I took a look at what you did with plop and prettier and think this was a simpler solution: 6c40012

Lmk if you think I missed something though.

@lock
Copy link

lock bot commented Jul 29, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants