Skip to content

Commit

Permalink
chore: lint config + indent
Browse files Browse the repository at this point in the history
  • Loading branch information
smarroufin committed Feb 1, 2024
1 parent d1f7bcd commit 1f5ddf0
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 17 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
8 changes: 6 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ module.exports = {
// Vue
'vue/multi-word-component-names': 0,
'vue/max-attributes-per-line': 'off',
'vue/no-v-html': 0
'vue/no-v-html': 0,
'vue/html-indent': ['error', 2],
'vue/script-indent': ['error', 2, { baseIndent: 0 }],
// Typescript
'@typescript-eslint/indent': ['error', 2],
}
}
}
2 changes: 1 addition & 1 deletion _nuxthub/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default defineNuxtConfig({
// ./modules are autoloaded
})
})
2 changes: 1 addition & 1 deletion _nuxthub/server/api/_hub/database/query.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ export default eventHandler(async (event) => {
message: `Database error: ${e.message}`
})
}
})
})
2 changes: 1 addition & 1 deletion _nuxthub/server/middleware/hub-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export default eventHandler(async (event) => {
// authorization: `Bearer ${secretKey}`
// }
// })
})
})
2 changes: 1 addition & 1 deletion _nuxthub/server/utils/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ export function useDatabaseClient () {
useDatabase()
}
return _client
}
}
2 changes: 1 addition & 1 deletion _nuxthub/server/utils/fixes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export async function readFormDataFixed(event: H3Event) : Promise<FormData> {
body: await readRawBody(event),
} as RequestInit)
return await request.formData()
}
}
2 changes: 1 addition & 1 deletion _nuxthub/server/utils/zod.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { z } from 'zod'
export { z } from 'zod'
2 changes: 1 addition & 1 deletion middleware/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default defineNuxtRouteMiddleware(() => {
if (!loggedIn.value) {
return navigateTo('/')
}
})
})
2 changes: 1 addition & 1 deletion server/api/db-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default defineEventHandler(async (event) => {
// const updated = await db.update(todos).set({ text: 'Bonjour' }).where(eq(todos.id, inserted.id)).returning()
const all = await db.select().from(todos).limit(3)
// const deleted = await db.delete(todos).where(eq(todos.id, all[0].id))

return {
// tables,
// todo,
Expand Down
2 changes: 1 addition & 1 deletion server/api/todos/[id].delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export default eventHandler(async (event) => {
})
}
return deletedTodo
})
})
2 changes: 1 addition & 1 deletion server/api/todos/[id].patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ export default eventHandler(async (event) => {
)).returning().get()

return todo
})
})
2 changes: 1 addition & 1 deletion server/api/todos/index.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default eventHandler(async (event) => {
const todos = await useDatabase().select().from(tables.todos).where(eq(tables.todos.userId, session.user.id)).all()

return todos
})
})
2 changes: 1 addition & 1 deletion server/api/todos/index.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export default eventHandler(async (event) => {
}).returning().get()

return todo
})
})
2 changes: 1 addition & 1 deletion server/api/todos/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export default eventHandler(async () => {
todos: sql<number>`count(*)`,
users: sql<number>`count(distinct(${tables.todos.userId}))`
}).from(tables.todos).get()
})
})
2 changes: 1 addition & 1 deletion server/database/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export const todos = sqliteTable('todos', {
title: text('title').notNull(),
completed: integer('completed').notNull().default(0),
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
})
})
2 changes: 1 addition & 1 deletion server/plugins/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default defineNitroPlugin(async () => {
if (process.dev) {
migrate(useDatabase() as BetterSQLite3Database, { migrationsFolder: 'server/database/migrations' })
}
})
})

0 comments on commit 1f5ddf0

Please sign in to comment.