diff --git a/docs/setup.md b/docs/setup.md new file mode 100644 index 0000000000..caa599d753 --- /dev/null +++ b/docs/setup.md @@ -0,0 +1,43 @@ +In order to use the react eslint plugin do the following... + +1. At the root of your project type npm install --save-dev eslint-plugin-react +2. Check your package.json 'devDependencies' for the following entries (version numbers may vary, but it's important that **the eslint version matches the peerDependency version in eslint-plugin-react**)... +
+  "devDependencies": {
+    "eslint": "^7.3.1",
+    "eslint-plugin-react": "^7.10.3"
+  }
+
+3. If configuring using package.json add the following under 'eslintConfig'... +
+  "eslintConfig": {
+    "plugins": [
+      "react"
+    ]
+   }
+
+Else, in your eslint configuration file (.eslintrc) add the following... +
+  {
+    "plugins": [
+      "react"
+    ]
+  }
+
+4. Configure the rules you want to use according to the [rules docs](/docs/rules). Here's a sample of some of mine... +
+  "eslintConfig": {
+    "rules": {
+      "no-unused-vars": 2,
+      "react/jsx-uses-vars": 2,
+      "react/require-extensions": 0,
+      "react/jsx-sort-prop-types": 0,
+      "react/prop-types": [2, {
+        "ignore": ["children"],
+        "skipUndeclared": false
+      }]
+    }
+   }
+
+ +You can read more about configuring ESLint plugins at http://eslint.org/docs/user-guide/configuring#configuring-plugins