diff --git a/.eslintrc.json b/.eslintrc.json index 883aa02..14508ef 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,8 +9,17 @@ "plugins": ["@typescript-eslint", "prettier"], "parser": "@typescript-eslint/parser", "parserOptions": { - "project": "./tsconfig.eslint.json" + "project": "./tsconfig.json" }, + "ignorePatterns": ["tests/**/*"], + "overrides": [ + { + "parserOptions": { + "project": "./tests/tsconfig.json" + }, + "files": ["tests/**/*"] + } + ], "rules": { "no-console": "off", "prettier/prettier": "error", diff --git a/bun.lockb b/bun.lockb index 74d30b7..32b16ee 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 22f2bf0..c1ddb99 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@types/mocha": "^8.2.0", "@types/node": "^14.14.22", "@types/node-fetch": "^2.5.8", - "bun-types": "^1.0.3", + "bun-types": "^1.0.7", "eslint": "^8.52.0", "eslint-config-airbnb-typescript": "^17.1.0", "eslint-config-prettier": "^9.0.0", diff --git a/tests/tsconfig.json b/tests/tsconfig.json new file mode 100644 index 0000000..a1928a8 --- /dev/null +++ b/tests/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../tsconfig.json", + "include": ["../src/**/*", "./**/*.ts"], + "compilerOptions": { + "types": [ + "bun-types" // add Bun global + ] + } +} diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..a36fbb6 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es2015", + "skipLibCheck": true, + "types": ["./src/@types/dns-packet"] + } +} diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json deleted file mode 100644 index 63f834a..0000000 --- a/tsconfig.eslint.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": ["tests"] -} diff --git a/tsconfig.json b/tsconfig.json index 163bdce..82f9928 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,9 @@ { + "extends": "./tsconfig.base.json", "compilerOptions": { - "module": "commonjs", - "target": "es2015", "declaration": true, - "skipLibCheck": true, "outDir": "./dist", - "types": [ - "bun-types", // add Bun global - "./src/@types/dns-packet" - ] + "types": ["node"] }, "include": ["src/**/*"] }