From e2b7f5c7cc7b422bec5b6571989507a17c84ad9f Mon Sep 17 00:00:00 2001 From: Karol Date: Sat, 4 Jan 2025 15:07:22 +0100 Subject: [PATCH] feat: Update Typescript config --- eslint.config.js | 5 +++-- package.json | 2 +- tsconfig.eslint.json | 5 +++++ tsconfig.json | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 tsconfig.eslint.json diff --git a/eslint.config.js b/eslint.config.js index 0dac5a3..adeb482 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -31,8 +31,9 @@ export default [ // Setting the parser to TypeScript parser parser: tsParser, parserOptions: { - // Specifying the path to the TypeScript configuration file - project: "./tsconfig.json", + // Specifying the path to the TypeScript configuration file, we use a + // custom one to fix tests parsing. + project: "./tsconfig.eslint.json", }, }, rules: { diff --git a/package.json b/package.json index b06e90d..7e642a5 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "build": "pnpm run clean && tsc", "clean": "rm -rf ./dist", "generate": "tsx ./ts-signatures-generator", - "lint": "eslint .", + "lint": "eslint ./src", "prepack": "pnpm run build", "test": "vitest ./src --run", "test:watch": "vitest ./src", diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json new file mode 100644 index 0000000..88bc284 --- /dev/null +++ b/tsconfig.eslint.json @@ -0,0 +1,5 @@ +{ + "extends": "./tsconfig.json", + "include": ["src/**/*"], // Include all source files, including tests + "exclude": ["node_modules", "dist"] // Clear the exclude list to ensure tests are included +} diff --git a/tsconfig.json b/tsconfig.json index b8f3fa3..3e7698c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,6 @@ "*": ["*", "src/*"] } }, - "include": ["src/index.ts", "src/**/*.ts", "src/**/*.spec.ts"], - "exclude": ["node_modules", "dist"] + "include": ["src/index.ts"], + "exclude": ["node_modules", "dist", "src/**/*.spec.ts"] }