Skip to content

Commit

Permalink
code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
arily committed Jan 10, 2024
1 parent df2db2b commit a775fa6
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 66 deletions.
43 changes: 43 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
plugins: ['vue'],
extends: ['eslint:recommended', 'plugin:vue/vue3-recommended', '@antfu'],
// add your custom rules here
rules: {
'vue/multi-word-component-names': ['off'],
'vue/no-v-model-argument': ['off'],
'@typescript-eslint/type-annotation-spacing': 'warn',
'curly': ['error', 'multi-line', 'consistent'],
'@typescript-eslint/comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'only-multiline',
enums: 'always-multiline',
generics: 'always-multiline',
tuples: 'always-multiline',
},
],
'@typescript-eslint/no-namespace': 'off',
// 'import/consistent-type-specifier-style': ['warn', 'prefer-top-level'],
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
fixStyle: 'inline-type-imports',
},
],
'import/no-duplicates': [
'error',
{ 'prefer-inline': true, 'considerQueryString': true },
],
},
}
38 changes: 0 additions & 38 deletions .eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .lazy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ return {
formatters_by_ft = {
vue = { "volar", "eslint_d" },
typescript = { "typescript", "eslint_d" },
javascript = { "typescript", "eslint_d" },
},
},
},
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "guccho",
"version": "1.3.0",
"private": true,
"type": "module",
"scripts": {
"build": "nuxi build",
"build:schemas": "node scripts/build-schema.mjs",
Expand Down Expand Up @@ -84,7 +85,6 @@
"superjson": "^2.0.0",
"switch-pattern": "^0.2.1",
"systeminformation": "^5.21.12",
"tailwind-highlightjs": "^2.0.1",
"trpc-nuxt": "^0.10.12",
"ts-enum-util": "^4.0.2",
"ts-mixer": "^6.0.3",
Expand Down Expand Up @@ -119,14 +119,15 @@
"daisyui": "^3.9.3",
"drizzle-kit": "^0.20.6",
"eslint": "^8.54.0",
"eslint-plugin-drizzle": "^0.2.2",
"eslint-plugin-drizzle": "^0.2.3",
"eslint-plugin-vue": "^9.17.0",
"nuxt": "^3.9.0",
"nuxt-animejs": "^2.0.0",
"nuxt-icon": "^0.5.0",
"pinia": "^2.0.0",
"prisma": "^5.4.2",
"sass": "^1.69.3",
"tailwind-highlightjs": "^2.0.1",
"typescript": "^5.2.2",
"vue-tsc": "^1.8.19"
}
Expand Down
65 changes: 45 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/server/.eslintrc.js → src/server/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ module.exports = {
env: {
browser: false,
},
plugins: ['drizzle'],
extends: ['plugin:drizzle/all'],
// add your custom rules here
rules: {
'antfu/no-const-enum': ['off'],
'drizzle/enforce-delete-with-where': [
'error',
{ drizzleObjectName: ['db', 'drizzle'] },
],
},
plugins: ['drizzle'],
extends: ['plugin:drizzle/all'],
}
1 change: 0 additions & 1 deletion src/server/backend/$base/server/session/session-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export class MemorySessionStore<TSession extends Session<any>, TSessionId extend
}

async destroy(key: TSessionId): Promise<boolean> {
// eslint-disable-next-line drizzle/enforce-delete-with-where
return this.store.delete(key)
}

Expand Down
2 changes: 0 additions & 2 deletions src/server/backend/bancho.py/server/user-relations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ export class UserRelationProvider implements Base<Id> {
throw new Error('not-found')
}

// it's prisma, don't worry about it
// eslint-disable-next-line drizzle/enforce-delete-with-where
await this.prisma.relationship.delete({
where: {
fromUserId_toUserId: {
Expand Down
1 change: 0 additions & 1 deletion src/server/trpc/routers/article.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export const router = _router({

delete: adminProcedure.input(object({
slug: string().trim(),
// eslint-disable-next-line drizzle/enforce-delete-with-where
})).mutation(({ input, ctx }) => articles.delete(Object.assign(input, { user: ctx.user }))),

localSlugs: adminProcedure.input(string().trim().optional()).query(({ input }) => ArticleProvider.getLocalSlugs(input)),
Expand Down

0 comments on commit a775fa6

Please sign in to comment.