From a6eeca38c9ddb2ef76aa176e1ae0a366767d1985 Mon Sep 17 00:00:00 2001 From: ykaiboussiSO Date: Mon, 23 Dec 2024 14:06:59 -0600 Subject: [PATCH] configure eslint for e2e project --- cmd/e2e/.env-cmdrc.example | 2 +- cmd/e2e/eslint.config.js | 12 ++++++++++++ cmd/e2e/package.json | 10 ++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 cmd/e2e/eslint.config.js diff --git a/cmd/e2e/.env-cmdrc.example b/cmd/e2e/.env-cmdrc.example index 9a266cda2..f07051cb8 100644 --- a/cmd/e2e/.env-cmdrc.example +++ b/cmd/e2e/.env-cmdrc.example @@ -1,7 +1,7 @@ { "dev": { "ENV": "dev", - "BASEURL": "bloodhound.localhost", + "BASEURL": "http://bloodhound.localhost", "DEFAULT_BROWSER":"chrome" }, "staging": { diff --git a/cmd/e2e/eslint.config.js b/cmd/e2e/eslint.config.js new file mode 100644 index 000000000..388d103fe --- /dev/null +++ b/cmd/e2e/eslint.config.js @@ -0,0 +1,12 @@ +import globals from "globals"; +import pluginJs from "@eslint/js"; +import tseslint from "typescript-eslint"; + + +/** @type {import('eslint').Linter.Config[]} */ +export default [ + {files: ["**/*.{js,mjs,cjs,ts}"]}, + {languageOptions: { globals: globals.node }}, + pluginJs.configs.recommended, + ...tseslint.configs.recommended, +]; \ No newline at end of file diff --git a/cmd/e2e/package.json b/cmd/e2e/package.json index b8ce46085..49a549ab0 100644 --- a/cmd/e2e/package.json +++ b/cmd/e2e/package.json @@ -8,12 +8,14 @@ "generate:prisma": "yarn prisma db pull && yarn prisma generate", "pretest": "tsc src/helpers/init.ts", "test:e2e": "env-cmd -e dev cucumber-js --config=src/cucumber.json --tags '@e2e'", - "test:failed": "env-cmd -e dev cucumber-js -p rerun --config=src/cucumber.json @rerun.txt" + "test:failed": "env-cmd -e dev cucumber-js -p rerun --config=src/cucumber.json @rerun.txt", + "lint": "eslint src prisma" }, "type": "module", "description": "E2E BDD Tests", "devDependencies": { "@cucumber/cucumber": "^11.0.1", + "@eslint/js": "^9.17.0", "@faker-js/faker": "^9.0.3", "@playwright/browser-chromium": "1.49.0", "@playwright/browser-firefox": "1.49.0", @@ -23,9 +25,13 @@ "@types/uuid": "^10.0.0", "dotenv": "^16.4.5", "env-cmd": "^10.1.0", + "eslint": "^9.17.0", + "globals": "^15.14.0", "playwright": "1.49.0", "prisma": "5.22.0", - "typescript": "5.6.3" + "ts-node": "^10.9.2", + "typescript": "5.6.3", + "typescript-eslint": "^8.18.2" }, "dependencies": { "@prisma/client": "5.22.0",