Bläddra i källkod

[misc] add linting for missing explicit dependencies and fix any errors

Jakob Ackermann 5 år sedan
förälder
incheckning
126f5bef11
3 ändrade filer med 16 tillägg och 5 borttagningar
  1. 11 2
      services/filestore/.eslintrc
  2. 4 2
      services/filestore/Makefile
  3. 1 1
      services/filestore/buildscript.txt

+ 11 - 2
services/filestore/.eslintrc

@@ -22,7 +22,10 @@
   "rules": {
     // Swap the no-unused-expressions rule with a more chai-friendly one
     "no-unused-expressions": 0,
-    "chai-friendly/no-unused-expressions": "error"
+    "chai-friendly/no-unused-expressions": "error",
+
+    // Do not allow importing of implicit dependencies.
+    "import/no-extraneous-dependencies": "error"
   },
   "overrides": [
     {
@@ -57,7 +60,13 @@
       "files": ["app/**/*.js", "app.js", "index.js"],
       "rules": {
         // don't allow console.log in backend code
-        "no-console": "error"
+        "no-console": "error",
+
+        // Do not allow importing of implicit dependencies.
+        "import/no-extraneous-dependencies": ["error", {
+          // Do not allow importing of devDependencies.
+          "devDependencies": false
+        }]
       }
     }
   ]

+ 4 - 2
services/filestore/Makefile

@@ -21,8 +21,10 @@ DOCKER_COMPOSE_TEST_UNIT = \
 	COMPOSE_PROJECT_NAME=test_unit_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE)
 
 clean:
-	docker rmi ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
-	docker rmi gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
+	-docker rmi ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
+	-docker rmi gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
+	-$(DOCKER_COMPOSE_TEST_UNIT) down --rmi local
+	-$(DOCKER_COMPOSE_TEST_ACCEPTANCE) down --rmi local
 
 format:
 	$(DOCKER_COMPOSE) run --rm test_unit npm run --silent format

+ 1 - 1
services/filestore/buildscript.txt

@@ -6,4 +6,4 @@ filestore
 --env-pass-through=
 --node-version=12.20.1
 --public-repo=True
---script-version=3.4.0
+--script-version=3.8.0