{"id":598,"hash":"ab909d86252c8b99faaa63c42f3b9fd37bb1ce0d0e8aab8ca7cbdeed749f8f73","pattern":"How do you fix ESLint Parsing error: Unexpected token error","full_message":"I get this eslint related error: Parsing error: Unexpected token\n\nHere is my eslint config:\n\n    {\n      \"extends\": \"airbnb\",\n      \"rules\": {\n        /* JSX */\n        \"react/prop-types\": [1, {\n          \"ignore\": [\"className\", \"children\", \"location\", \"params\", \"location*\"]\n        }],\n        \"no-param-reassign\": [0, {\n          \"props\": false\n        }],\n        \"prefer-rest-params\": 1,\n        \"arrow-body-style\": 0,\n        \"prefer-template\": 0,\n        \"react/prefer-stateless-function\": 1,\n        \"react/jsx-no-bind\": [0, {\n          \"ignoreRefs\": false,\n          \"allowArrowFunctions\": false,\n          \"allowBind\": true\n        }],\n      }\n    }\n\nWhat is the problem ?","ecosystem":"npm","package_name":"reactjs","package_version":null,"solution":"Unexpected token errors in ESLint parsing occur due to incompatibility between your development environment and ESLint's current parsing capabilities with the ongoing changes with JavaScripts ES6~7.\n\nAdding the \"parserOptions\" property to your .eslintrc is no longer enough for particular situations, such as using\n\nstatic contextTypes = { ... } /* react */\n\nin ES6 classes as ESLint is currently unable to parse it on its own. This particular situation will throw an error of:\n\nerror Parsing error: Unexpected token =\n\nThe solution is to have ESLint parsed by a compatible parser, i.e @babel/eslint-parser or babel-eslint for babel version below v7.\n\njust add:\n\n\"parser\": \"@babel/eslint-parser\"\n\nto your .eslintrc file and run npm install @babel/eslint-parser --save-dev or yarn add -D @babel/eslint-parser. If you use pnpm, you can instead run pnpm add -D @babel/eslint-parser.\n\nPlease note that as the new Context API starting from React ^16.3 has some important changes, please refer to the official guide.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/36001552/how-do-you-fix-eslint-parsing-error-unexpected-token-error","votes":335,"created_at":"2026-04-19T04:51:24.110766+00:00","updated_at":"2026-04-19T04:51:24.110766+00:00"}