set up eslint and prettier
This commit is contained in:
3
packages/auth/eslint.config.mjs
Normal file
3
packages/auth/eslint.config.mjs
Normal file
@@ -0,0 +1,3 @@
|
||||
import baseConfig from "@zendegi/eslint-config/base";
|
||||
|
||||
export default baseConfig;
|
||||
@@ -9,7 +9,9 @@
|
||||
"default": "./src/*.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {},
|
||||
"scripts": {
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@zendegi/db": "workspace:*",
|
||||
"@zendegi/env": "workspace:*",
|
||||
@@ -19,6 +21,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@zendegi/config": "workspace:*",
|
||||
"@zendegi/eslint-config": "workspace:*",
|
||||
"eslint": "^9.17.0",
|
||||
"typescript": "catalog:"
|
||||
}
|
||||
}
|
||||
|
||||
3
packages/db/eslint.config.mjs
Normal file
3
packages/db/eslint.config.mjs
Normal file
@@ -0,0 +1,3 @@
|
||||
import baseConfig from "@zendegi/eslint-config/base";
|
||||
|
||||
export default baseConfig;
|
||||
@@ -14,6 +14,7 @@
|
||||
"db:generate": "drizzle-kit generate",
|
||||
"db:studio": "drizzle-kit studio",
|
||||
"db:migrate": "drizzle-kit migrate",
|
||||
"lint": "eslint .",
|
||||
"db:start": "docker compose up -d",
|
||||
"db:watch": "docker compose up",
|
||||
"db:stop": "docker compose stop",
|
||||
@@ -29,7 +30,9 @@
|
||||
"devDependencies": {
|
||||
"@types/pg": "^8.16.0",
|
||||
"@zendegi/config": "workspace:*",
|
||||
"@zendegi/eslint-config": "workspace:*",
|
||||
"drizzle-kit": "^0.31.8",
|
||||
"eslint": "^9.17.0",
|
||||
"typescript": "catalog:"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { relations } from "drizzle-orm";
|
||||
import { pgTable, text, timestamp, boolean, index } from "drizzle-orm/pg-core";
|
||||
import { boolean, index, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
||||
|
||||
export const user = pgTable("user", {
|
||||
id: text("id").primaryKey(),
|
||||
@@ -30,7 +30,7 @@ export const session = pgTable(
|
||||
.notNull()
|
||||
.references(() => user.id, { onDelete: "cascade" }),
|
||||
},
|
||||
(table) => [index("session_userId_idx").on(table.userId)],
|
||||
(table) => [index("session_userId_idx").on(table.userId)]
|
||||
);
|
||||
|
||||
export const account = pgTable(
|
||||
@@ -54,7 +54,7 @@ export const account = pgTable(
|
||||
.$onUpdate(() => /* @__PURE__ */ new Date())
|
||||
.notNull(),
|
||||
},
|
||||
(table) => [index("account_userId_idx").on(table.userId)],
|
||||
(table) => [index("account_userId_idx").on(table.userId)]
|
||||
);
|
||||
|
||||
export const verification = pgTable(
|
||||
@@ -70,7 +70,7 @@ export const verification = pgTable(
|
||||
.$onUpdate(() => /* @__PURE__ */ new Date())
|
||||
.notNull(),
|
||||
},
|
||||
(table) => [index("verification_identifier_idx").on(table.identifier)],
|
||||
(table) => [index("verification_identifier_idx").on(table.identifier)]
|
||||
);
|
||||
|
||||
export const userRelations = relations(user, ({ many }) => ({
|
||||
|
||||
3
packages/env/eslint.config.mjs
vendored
Normal file
3
packages/env/eslint.config.mjs
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import baseConfig from "@zendegi/eslint-config/base";
|
||||
|
||||
export default baseConfig;
|
||||
5
packages/env/package.json
vendored
5
packages/env/package.json
vendored
@@ -7,6 +7,9 @@
|
||||
"./server": "./src/server.ts",
|
||||
"./web": "./src/web.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@t3-oss/env-core": "^0.13.1",
|
||||
"dotenv": "catalog:",
|
||||
@@ -15,6 +18,8 @@
|
||||
"devDependencies": {
|
||||
"@types/node": "catalog:",
|
||||
"@zendegi/config": "workspace:*",
|
||||
"@zendegi/eslint-config": "workspace:*",
|
||||
"eslint": "^9.17.0",
|
||||
"typescript": "catalog:"
|
||||
}
|
||||
}
|
||||
|
||||
4
packages/env/src/server.ts
vendored
4
packages/env/src/server.ts
vendored
@@ -8,7 +8,9 @@ export const env = createEnv({
|
||||
BETTER_AUTH_SECRET: z.string().min(32),
|
||||
BETTER_AUTH_URL: z.url(),
|
||||
CORS_ORIGIN: z.url(),
|
||||
NODE_ENV: z.enum(["development", "production", "test"]).default("development"),
|
||||
NODE_ENV: z
|
||||
.enum(["development", "production", "test"])
|
||||
.default("development"),
|
||||
},
|
||||
runtimeEnv: process.env,
|
||||
emptyStringAsUndefined: true,
|
||||
|
||||
3
packages/eslint-config/base.js
Normal file
3
packages/eslint-config/base.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import { tanstackConfig } from "@tanstack/eslint-config";
|
||||
|
||||
export default [...tanstackConfig];
|
||||
20
packages/eslint-config/package.json
Normal file
20
packages/eslint-config/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "@zendegi/eslint-config",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./base": "./base.js",
|
||||
"./react": "./react.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/eslint-config": "^0.3.4",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"eslint-plugin-react": "^7.37.0",
|
||||
"eslint-plugin-react-hooks": "^5.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^9.0.0",
|
||||
"typescript": "^5.0.0"
|
||||
}
|
||||
}
|
||||
38
packages/eslint-config/react.js
vendored
Normal file
38
packages/eslint-config/react.js
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import jsxA11y from "eslint-plugin-jsx-a11y";
|
||||
import react from "eslint-plugin-react";
|
||||
import reactHooks from "eslint-plugin-react-hooks";
|
||||
import baseConfig from "./base.js";
|
||||
|
||||
export default [
|
||||
...baseConfig,
|
||||
{
|
||||
files: ["**/*.tsx", "**/*.jsx"],
|
||||
...react.configs.flat.recommended,
|
||||
...react.configs.flat["jsx-runtime"],
|
||||
settings: {
|
||||
react: { version: "detect" },
|
||||
},
|
||||
rules: {
|
||||
...react.configs.flat.recommended.rules,
|
||||
...react.configs.flat["jsx-runtime"].rules,
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react/prop-types": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["**/*.tsx", "**/*.jsx"],
|
||||
plugins: { "react-hooks": reactHooks },
|
||||
rules: {
|
||||
"react-hooks/rules-of-hooks": "error",
|
||||
"react-hooks/exhaustive-deps": "warn",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["**/*.tsx", "**/*.jsx"],
|
||||
...jsxA11y.flatConfigs.recommended,
|
||||
rules: {
|
||||
...jsxA11y.flatConfigs.recommended.rules,
|
||||
"jsx-a11y/label-has-associated-control": ["error", { assert: "either" }],
|
||||
},
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user