Skip to content

Instantly share code, notes, and snippets.

@deadcoder0904
Last active October 14, 2017 09:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deadcoder0904/c90f2c63c0a7b8bf0215b59ed1bd1352 to your computer and use it in GitHub Desktop.
Save deadcoder0904/c90f2c63c0a7b8bf0215b59ed1bd1352 to your computer and use it in GitHub Desktop.
ESLINT CONFIG

Step 1 : Install eslint & babel-eslint

yarn add eslint babel-eslint -D

Step 2 : Start setup

./node_modules/.bin/eslint --init

Step 3 : Add the following to .eslintrc.json

{
  "extends": "airbnb",
  "parser": "babel-eslint",
  "env": {
    "browser": true
  },
  "plugins": ["react"],
  "rules": {
    "react/jsx-filename-extension": [
      2,
      {
        "extensions": [".js", ".jsx"]
      }
    ],
    "react/forbid-prop-types": [0],
    "react/require-default-props": [0],
    "global-require": [0],
    "no-underscore-dangle": [0]
  }
}

Step 4 : Add the following to package.json

"scripts": {
  "lint": "eslint app/",
  "lint:fix": "eslint app/ --fix"
},

Step 5 : Add this to .vscode/settings.json

{
  "prettier.eslintIntegration": true,
  "editor.formatOnSave": true,
  "files.exclude": {
    "**/*.git": true,
    "**/*.expo": true,
    ".*": true,
    "**/*.DS_Store": true,
    "node_modules/": true
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment