Skip to content

Commit ae77458

Browse files
committed
chore:configure drizzle orm and database setup
1 parent 5f9e770 commit ae77458

12 files changed

Lines changed: 1393 additions & 239 deletions

drizzle.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import "dotenv/config";
2+
import { defineConfig } from "drizzle-kit";
3+
4+
if (!process.env.DATABASE_URL) {
5+
throw new Error("DATABASE_URL is not defined in the environment variables");
6+
}
7+
8+
export default defineConfig({
9+
schema: "./src/db/schema/index.ts",
10+
out: "./src/db/migrations",
11+
dialect: "postgresql",
12+
dbCredentials: {
13+
url: process.env.DATABASE_URL,
14+
},
15+
verbose: true,
16+
strict: true,
17+
});

eslint.config.mjs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
import js from "@eslint/js";
2+
import tseslint from "typescript-eslint";
3+
import importX from "eslint-plugin-import-x";
4+
import globals from "globals";
25

3-
export default [
6+
export default tseslint.config(
47
js.configs.recommended,
8+
...tseslint.configs.recommended,
59
{
10+
languageOptions: {
11+
globals: globals.node,
12+
},
13+
plugins: {
14+
"import-x": importX,
15+
},
16+
settings: {
17+
"import-x/resolver": {
18+
typescript: {
19+
project: "./tsconfig.json",
20+
},
21+
},
22+
},
623
rules: {
7-
// add custom rules here
24+
"import-x/no-unresolved": "error",
825
},
926
},
10-
];
27+
);

0 commit comments

Comments
 (0)