Skip to content

Instantly share code, notes, and snippets.

@belachkar
Last active January 2, 2020 03:50
Show Gist options
  • Save belachkar/ac7f31c0735736976b5eead002870f44 to your computer and use it in GitHub Desktop.
Save belachkar/ac7f31c0735736976b5eead002870f44 to your computer and use it in GitHub Desktop.

Eslint config

Additional Packages for eslint react compatibility

babel-eslint v.8 required for estlint v.4 and above.

Name Version
babel-eslint ^8
eslint-plugin-react *

.eslintrc.json

{
  "extends": [
    "plugin:react/recommended"
  ],
  "env": {
    "node": true,
    "browser": true,
    "es2017": true
  },
  "parserOptions": {
    "sourceType": "module"
  },
  "plugins": [
    "eslint-plugin-react"
  ],
  "parser": "babel-eslint",
  "settings": {
    "react": {
      "createClass": "createReactClass",
      "pragma": "React",
      "version": "detect",
      "flowVersion": "0.53"
    },
    "propWrapperFunctions": [
      "forbidExtraProps",
      {
        "property": "freeze",
        "object": "Object"
      },
      {
        "property": "myFavoriteWrapper"
      }
    ],
    "linkComponents": [
      "Hyperlink",
      {
        "name": "Link",
        "linkAttribute": "to"
      }
    ]
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment