diff --git a/.gitignore b/.gitignore index 99e55d97..9c983d3e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /node_modules /dist +/out-tsc .env .env.* !.env.example diff --git a/eslint.config.js b/eslint.config.js index 42f2f70a..28ecad7e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -17,7 +17,7 @@ export default tseslint.config( parserOptions: { sourceType: "module", ecmaVersion: "latest", - project: ["tsconfig.json", "tsconfig.*.json"], + projectService: true, }, globals: { ...globals.node, @@ -48,6 +48,6 @@ export default tseslint.config( ], }, }, - { ignores: ["dist/", ".husky/install.mjs"] }, + { ignores: ["dist/", "out-tsc/", ".husky/install.mjs"] }, eslintConfigPrettier, ); diff --git a/package.json b/package.json index 2763c595..d009dd91 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "fix": "run-s -c *:fix", "format:check": "prettier --check .", "format:fix": "prettier --write .", - "type:check": "tsc --noEmit", + "type:check": "tsc --build", "lint:check": "eslint .", "lint:fix": "eslint . --fix", "prepare": "node .husky/install.mjs", diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 00000000..c22d3aac --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "module": "ESNext", + "moduleResolution": "Bundler" + }, + "include": ["**/*"] +} diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 00000000..3c6f7891 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "rootDir": ".", + "outDir": "out-tsc", + "composite": true, + "emitDeclarationOnly": true, + + "target": "ES2022", + "lib": ["ESNext"], + "types": ["node"], + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "verbatimModuleSyntax": true + } +} diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json deleted file mode 100644 index e08eefc8..00000000 --- a/tsconfig.eslint.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "noEmit": true, - "allowJs": true - }, - "extends": "./tsconfig.json", - "include": ["**/*.js"], - "exclude": ["node_modules/", "dist/"] -} diff --git a/tsconfig.json b/tsconfig.json index dc2d685c..a3f7f31b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,16 +1,4 @@ { - "compilerOptions": { - "target": "ES2022", - "module": "ESNext", - "moduleResolution": "Bundler", - "lib": ["ESNext"], - "types": ["node"], - "noEmit": true, - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "verbatimModuleSyntax": true - }, - "include": ["src/**/*"] + "files": [], + "references": [{ "path": "./src/" }, { "path": "./tsconfig.node.json" }] } diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 00000000..4c347c73 --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "module": "NodeNext", + "allowJs": true, + "checkJs": true + }, + "include": ["scripts/**/*", "*.config.js"] +}