From 535bc043e827ef9d03309561aae524d3e4857c2f Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Wed, 4 Jan 2023 21:10:05 -0800 Subject: [PATCH 1/2] Use @babel/eslint-parser instead of babel-eslint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not sure why babel-eslint was used when it was missing from package-lock. Use the newer NPM package¹, which is already installed by another dependency. ¹ https://www.npmjs.com/package/babel-eslint --- react-app/eslint.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-app/eslint.config.js b/react-app/eslint.config.js index 391298c..3afba5f 100644 --- a/react-app/eslint.config.js +++ b/react-app/eslint.config.js @@ -24,7 +24,7 @@ export default [ ] }, "plugins": ["react", "import", "jsx-a11y"], - "parser": "react-scripts/node_modules/babel-eslint", + "parser": "@babel/eslint-parser", "parserOptions": { "ecmaVersion": 2018, "sourceType": "module", From 6d6390437e0786bb064286038d733320ca0a03f0 Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Wed, 4 Jan 2023 21:19:18 -0800 Subject: [PATCH 2/2] Install @babel/eslint-parser explicitly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Although @babel/eslint-parser is a nested dependency through react-scripts → eslint-config-react-app → @babel/eslint-parser, it is explicitly referenced in this project so it should be included as a direct dependency. --- react-app/package-lock.json | 1 + react-app/package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/react-app/package-lock.json b/react-app/package-lock.json index 9c97c77..4f964ba 100644 --- a/react-app/package-lock.json +++ b/react-app/package-lock.json @@ -22,6 +22,7 @@ "sass": "^1.56.1" }, "devDependencies": { + "@babel/eslint-parser": "^7.16.3", "eslint-config-airbnb": "^18.2.1", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.23.4", diff --git a/react-app/package.json b/react-app/package.json index 516abc5..3d52801 100644 --- a/react-app/package.json +++ b/react-app/package.json @@ -39,6 +39,7 @@ "sass": "^1.56.1" }, "devDependencies": { + "@babel/eslint-parser": "^7.16.3", "eslint-config-airbnb": "^18.2.1", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.23.4",