Skip to content

Instantly share code, notes, and snippets.

@vre2h
Last active July 22, 2018 11:12
Show Gist options
  • Select an option

  • Save vre2h/c8097e24d0ff37a36f96083e84fec239 to your computer and use it in GitHub Desktop.

Select an option

Save vre2h/c8097e24d0ff37a36f96083e84fec239 to your computer and use it in GitHub Desktop.
It's a simple react settings.
  1. Install eslint and prettier extensions in your editor.

  2. Install packages via yarn:

  yarn add --dev prettier 
  yarn add --dev eslint-plugin-prettier
  yarn add --dev react-test-renderer
  yarn add redux react-redux
  yarn add prop-types

Shorter:

  yarn add --dev prettier eslint-plugin-prettier react-test-renderer && yarn add redux react-redux prop-types
  1. Or npm:
  npm i --save-dev prettier 
  npm i --save-dev eslint-plugin-prettier
  npm i --save-dev react-test-renderer
  npm i --save redux react-redux
  npm i --save prop-types

Shorter:

  npm i --save-dev prettier eslint-plugin-prettier react-test-renderer && npm i --save redux react-redux prop-types
  1. Add some rules to .eslintrc
{
  "extends": "react-app",
  "plugins": ["prettier"],
  "rules": {
    "prettier/prettier": "error"
  }
}
  1. And to .prettierrc
{
  "singleQuote": true,
  "trailingComma": "es5"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment