best eslint prettier react config code example

Example: eslint prettier reactjs

$ yarn add eslint prettier eslint-config-prettier eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks

# .eslintrc
{
  "parser": "babel-eslint",
  "extends": ["airbnb-base", "prettier"],
  "plugins": ["import"],
  "env": {
    "browser": true,
    "es6": true
  },
  "globals": {},
  "rules": {
    "import/no-cycle": "warn",
  },
  "parserOptions": {
    "sourceType": "module"
  }
}


# .prettierc
{
  "printWidth": 100,
  "tabWidth": 2,
  "useTabs": false,
  "semi": true,
  "singleQuote": true,
  "arrowParens": "avoid",
  "trailingComma": "all"
}