From ba78dd60d8600976e234918c854c7d924bb1120f Mon Sep 17 00:00:00 2001 From: Tom Beckenham <34339192+tombeckenham@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:40:28 +1100 Subject: [PATCH] Updated eslint for e2e tests --- eslint.config.mjs | 7 ++++++- tsconfig.json | 3 +-- tsconfig.test.json | 7 +++++++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 tsconfig.test.json diff --git a/eslint.config.mjs b/eslint.config.mjs index e486f3f1..f9fcd4b4 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -86,7 +86,12 @@ export default [ // Test files specific config { - files: ['**/*.test.{js,jsx,ts,tsx}', '**/*.spec.{js,jsx,ts,tsx}'], + files: ['**/*.test.{js,jsx,ts,tsx}', '**/*.spec.{js,jsx,ts,tsx}', 'playwright.config.ts'], + languageOptions: { + parserOptions: { + project: './tsconfig.test.json', + }, + }, rules: { 'no-restricted-globals': 'off', '@typescript-eslint/no-explicit-any': 'off', diff --git a/tsconfig.json b/tsconfig.json index 5f704e22..1d570bc9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,8 +21,7 @@ "consts/*": ["./src/constant/*"], "assets": ["./src/ui/assets"], "changeLogs": ["./changeLogs"], - "react": ["./node_modules/@types/react"], - "tests": ["./tests/*"] + "react": ["./node_modules/@types/react"] }, "lib": ["ES2021.String", "DOM", "DOM.Iterable"], "types": ["chrome", "node", "react", "react-dom", "jest"], diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 00000000..8183471c --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "include": ["tests/**/*", "playwright.config.ts"], + "compilerOptions": { + "types": ["@playwright/test"] + } +}