Skip to content

Commit

Permalink
add editor config #61
Browse files Browse the repository at this point in the history
  • Loading branch information
ukorvl committed Oct 19, 2023
1 parent ce6b758 commit 76a8b14
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 53 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,7 @@ tags
# Persistent undo
[._]*.un~

*.pid
*.pid

.vscode/*
!.vscode/settings.json
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"editor.codeActionsOnSave": {
"quickfix.biome": true
},
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"biome.lspBin": "./site/node_modules/.bin/biome-lsp"
}
32 changes: 9 additions & 23 deletions admin/config/database.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');
const path = require('path')

module.exports = ({ env }) => {
const client = env('DATABASE_CLIENT', 'sqlite');
const client = env('DATABASE_CLIENT', 'sqlite')

const connections = {
mysql: {
Expand All @@ -18,10 +18,7 @@ module.exports = ({ env }) => {
ca: env('DATABASE_SSL_CA', undefined),
capath: env('DATABASE_SSL_CAPATH', undefined),
cipher: env('DATABASE_SSL_CIPHER', undefined),
rejectUnauthorized: env.bool(
'DATABASE_SSL_REJECT_UNAUTHORIZED',
true
),
rejectUnauthorized: env.bool('DATABASE_SSL_REJECT_UNAUTHORIZED', true),
},
},
pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) },
Expand All @@ -39,10 +36,7 @@ module.exports = ({ env }) => {
ca: env('DATABASE_SSL_CA', undefined),
capath: env('DATABASE_SSL_CAPATH', undefined),
cipher: env('DATABASE_SSL_CIPHER', undefined),
rejectUnauthorized: env.bool(
'DATABASE_SSL_REJECT_UNAUTHORIZED',
true
),
rejectUnauthorized: env.bool('DATABASE_SSL_REJECT_UNAUTHORIZED', true),
},
},
pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) },
Expand All @@ -61,33 +55,25 @@ module.exports = ({ env }) => {
ca: env('DATABASE_SSL_CA', undefined),
capath: env('DATABASE_SSL_CAPATH', undefined),
cipher: env('DATABASE_SSL_CIPHER', undefined),
rejectUnauthorized: env.bool(
'DATABASE_SSL_REJECT_UNAUTHORIZED',
true
),
rejectUnauthorized: env.bool('DATABASE_SSL_REJECT_UNAUTHORIZED', true),
},
schema: env('DATABASE_SCHEMA', 'public'),
},
pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) },
},
sqlite: {
connection: {
filename: path.join(
__dirname,
'..',
'..',
env('DATABASE_FILENAME', '.tmp/data.db')
),
filename: path.join(__dirname, '..', '..', env('DATABASE_FILENAME', '.tmp/data.db')),
},
useNullAsDefault: true,
},
};
}

return {
connection: {
client,
...connections[client],
acquireConnectionTimeout: env.int('DATABASE_CONNECTION_TIMEOUT', 60000),
},
};
};
}
}
34 changes: 34 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://biomejs.dev/schemas/1.2.2/schema.json",
"organizeImports": {
"enabled": false
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"lineWidth": 120,
"indentSize": 2
},
"linter": {
"enabled": true,
"ignore": [
"node_modules"
],
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off"
},
"correctness": {
"noUnusedVariables": "warn"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"trailingComma": "all",
"semicolons": "asNeeded"
}
}
}
28 changes: 0 additions & 28 deletions rome.json

This file was deleted.

2 changes: 1 addition & 1 deletion site/src/components/common/ArrowButton/ArrowButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function ArrowButton({ className, text, ...props }: ArrowButtonProps) {
return (
<Button className={cx(s.root, className)} {...props}>
{text}
<Icon name='arrow-up' className={s.icon} />
<Icon name="arrow-up" className={s.icon} />
</Button>
)
}
Expand Down

0 comments on commit 76a8b14

Please sign in to comment.