Skip to content

Instantly share code, notes, and snippets.

@dillon
Created May 20, 2019 16:17
Show Gist options
  • Save dillon/62c943feacf28b29cbf050ba6c25fdbc to your computer and use it in GitHub Desktop.
Save dillon/62c943feacf28b29cbf050ba6c25fdbc to your computer and use it in GitHub Desktop.

npm

npm i -D eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react prettier eslint-config-prettier eslint-plugin-prettier

yarn

yarn add --dev eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react prettier eslint-config-prettier eslint-plugin-prettier

create config files

touch .eslintrc

{
  "extends": ["airbnb", "prettier", "prettier/react"],
  "plugins": ["prettier"],
  "rules": {
    "react/jsx-filename-extension": [
      1,
      {
        "extensions": [".js", ".jsx"]
      }
    ],
    "react/prop-types": 0,
    "no-underscore-dangle": 0,
    "import/imports-first": ["error", "absolute-first"],
    "import/newline-after-import": "error"
  },
  "globals": {
    "window": true,
    "document": true,
    "localStorage": true,
    "FormData": true,
    "FileReader": true,
    "Blob": true,
    "navigator": true
  },
  "parser": "babel-eslint"
}

touch .prettierrc

{
  "singleQuote": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment