Ставлю eslint для уже существующего react проекта, проблема возникает со следующим кодом:
client = applyErrorProcessing(client, [401, 403, 404, 500]);
return client.catcher(400, response => {
const validationError = JSON.parse(response.message) as ValidationError;
if (validationError.errors) {
eslint кидает такую ошибку:
19:62 error Parsing error: Unexpected token, expected ";"
17 | client = applyErrorProcessing(client, [401, 403, 404, 500]);
18 | return client.catcher(400, response => {
> 19 | const validationError = JSON.parse(response.message) as ValidationError;
| ^
вот мои настройки из .eslintrc, хотя env никакого влияния на эту ошибку не оказывают
"extends": [ "airbnb", "eslint:recommended", "react-app" ],
"parser": "babel-eslint",
"env": {
"es6": true,
"node": true,
"browser": true,
"commonjs": true
},
вот package.json:
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-fontawesome": "^1.7.1",
"react-jss": "^10.0.3",
"react-redux": "^7.1.3",
"react-router-dom": "^5.1.2",
"react-select": "^3.0.8",
"react-toastify": "^5.4.1",
"redux": "^4.0.1",
"redux-localstorage": "^0.4.1",
"redux-thunk": "^2.3.0",
"typescript": "^3.7.3",
"html-webpack-plugin": "^3.2.0",
"react-scripts": "^3.0.1",
"eslint-config-airbnb": "^18.0.1",
"babel-eslint": "^10.0.3"