From ec52a3eb00aca6cd2cb624b87756a88fe91825c4 Mon Sep 17 00:00:00 2001
From: John Sparger <john.sparger@ess.eu>
Date: Fri, 25 Feb 2022 12:52:20 +0000
Subject: [PATCH] Pin eslint-plugin-react and switch to node 16 lts to allow
 build to succeed

---
 .gitlab-ci.yml |  7 ++++---
 Dockerfile     |  2 +-
 package.json   | 13 ++++++++-----
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5dfc3d54..51be4471 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,6 @@
 variables:
   CONTAINER_IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
+  NODE_IMAGE: "node:16.14.0"
 
 stages:
   - build
@@ -15,7 +16,7 @@ default:
 
 build:
   stage: build
-  image: node
+  image: $NODE_IMAGE
   script: 
     - npm install
     - CI=false npm run build
@@ -27,7 +28,7 @@ build:
 
 lint:
   stage: lint
-  image: node
+  image: $NODE_IMAGE
   script:
     - npm run code-quality
   artifacts:
@@ -36,7 +37,7 @@ lint:
 
 test:
   stage: test
-  image: node
+  image: $NODE_IMAGE
   script:
     - CI=true npm run coverage
   coverage: /^Lines\s*:\s*([^%]+)/
diff --git a/Dockerfile b/Dockerfile
index 3355e12f..46ac6a19 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
 # build CCCE Frontend
-FROM node:17.0.1 as builder
+FROM node:16.14.0 as builder
 RUN mkdir /usr/src/app
 WORKDIR /usr/src/app
 ENV PATH /usr/src/app/node_modules/.bin:$PATH
diff --git a/package.json b/package.json
index 534768d5..ca09cf72 100644
--- a/package.json
+++ b/package.json
@@ -34,13 +34,15 @@
     "web-vitals": "^0.2.4"
   },
   "resolutions": {
-    "//": "See https://github.com/facebook/create-react-app/issues/11773",
-    "react-scripts/**/react-error-overlay": "6.0.9"
+    "// react-scripts": "See https://github.com/facebook/create-react-app/issues/11773",
+    "react-scripts/**/react-error-overlay": "6.0.9",
+    "// eslint-plugin-react": "See https://github.com/yannickcr/eslint-plugin-react/issues/3215",
+    "eslint-plugin-react": "7.28.0"
   },
   "scripts": {
     "preinstall": "npx npm-force-resolutions", 
-    "start": "react-scripts --openssl-legacy-provider start",
-    "build": "react-scripts --openssl-legacy-provider build",
+    "start": "react-scripts start",
+    "build": "react-scripts build",
     "test": "set DEBUG_PRINT_LIMIT=20000&& react-scripts test",
     "coverage": "DEBUG_PRINT_LIMIT=20000 react-scripts test --env=jsdom --watchAll=false --coverage --passWithNoTests",
     "eject": "react-scripts eject",
@@ -79,7 +81,8 @@
     "jest-cucumber": "^3.0.1",
     "react-scripts": "^4.0.3",
     "serve": "^11.3.2",
-    "react-error-overlay": "6.0.9"
+    "react-error-overlay": "6.0.9",
+    "eslint-plugin-react": "7.28.0"
   },
   "cypress-cucumber-preprocessor": {
     "nonGlobalStepDefinitions": true
-- 
GitLab