From 7504d1f393128f7f1326cc526488d07e6a52ff54 Mon Sep 17 00:00:00 2001 From: alexrecuenco Date: Sun, 22 Sep 2024 23:45:36 +0200 Subject: [PATCH] Configure eslint for tests --- eslint.config.mjs | 8 +++++++- tests/tsconfig.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 854e274..c95472c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -163,8 +163,14 @@ export default [ 'jest.*.js', 'jest.*.ts', ], + ignores: ['jest.config.ts'], // https://eslint.org/docs/user-guide/configuring#specifying-environments - languageOptions: { globals: globals.jest }, + languageOptions: { + globals: { ...globals.jest, ...globals.node }, + parserOptions: { + project: ['./tests/tsconfig.json'], + }, + }, plugins: { jest }, rules: { ...jest.configs['recommended'].rules, diff --git a/tests/tsconfig.json b/tests/tsconfig.json index 99ed29d..341a5c6 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -6,6 +6,6 @@ "allowJs": true, "sourceMap": true, }, - "include": ["./**/*", "../src/**/*"], + "include": ["./**/*", "../src/**/*", "../jest.setup*"], "exclude": ["node_modules", "../*.config.*"], }