Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ vscode:
- eamodio.gitlens
- graphQL.vscode-graphql
- ZixuanChen.vitest-explorer
- esbenp.prettier-vscode
- oxc.oxc-vscode
- prisma.prisma
- bradlc.vscode-tailwindcss
- streetsidesoftware.code-spell-checker
Expand Down
5 changes: 5 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"semi": false,
"singleQuote": true
}
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

5 changes: 1 addition & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@
"type": "pwa-node",
"request": "launch",
"name": "Server: nuxt",
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!**/node_modules/**"
],
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"args": ["dev"],
"osx": {
"program": "${workspaceFolder}/node_modules/.bin/nuxt"
Expand Down
10 changes: 2 additions & 8 deletions config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ export enum Environment {
/**
* Taken from https://stackoverflow.com/a/41548441
*/
function enumFromStringValue<T>(
enm: Record<string, T>,
value: string,
): T | undefined {
function enumFromStringValue<T>(enm: Record<string, T>, value: string): T | undefined {
return (Object.values(enm) as unknown as string[]).includes(value)
? (value as unknown as T)
: undefined
Expand All @@ -49,10 +46,7 @@ function getEnvironment(): Environment {

if (process.env.NODE_ENV === undefined) return Environment.LocalDevelopment

return (
enumFromStringValue(Environment, process.env.NODE_ENV) ??
Environment.LocalDevelopment
)
return enumFromStringValue(Environment, process.env.NODE_ENV) ?? Environment.LocalDevelopment
}

export interface Config {
Expand Down
25 changes: 9 additions & 16 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// @ts-check
import graphqlPlugin from '@graphql-eslint/eslint-plugin'
import vitest from '@vitest/eslint-plugin'
import {
defineConfigWithVueTs,
vueTsConfigs,
} from '@vue/eslint-config-typescript'
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
import oxlint from 'eslint-plugin-oxlint'
import withNuxt from './.nuxt/eslint.config.mjs'

Expand All @@ -27,14 +24,13 @@ export default withNuxt({
// https://github.com/vuejs/eslint-config-typescript
// https://typescript-eslint.io/getting-started/typed-linting
// @ts-expect-error: @vue/eslint-config-typescript has problems with the type
defineConfigWithVueTs(
vueTsConfigs.stylisticTypeChecked,
vueTsConfigs.strictTypeChecked,
).map((config) => ({
...config,
// Activate ts rules only for ts files, otherwise they also apply to graphql -- which the parser doesn't understand
files: ['**/*.ts'],
})),
defineConfigWithVueTs(vueTsConfigs.stylisticTypeChecked, vueTsConfigs.strictTypeChecked).map(
(config) => ({
...config,
// Activate ts rules only for ts files, otherwise they also apply to graphql -- which the parser doesn't understand
files: ['**/*.ts'],
}),
),
)
.append({
// TS-specific rules
Expand All @@ -55,10 +51,7 @@ export default withNuxt({
// TODO: Remove this once all errors are fixed
'@typescript-eslint/no-redundant-type-constituents': 'warn',
// Allow numbers in templates without explicit casting
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowNumber: true },
],
'@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }],
// Use { type xyz } instead of type { xyz } for imports
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md
// Disabled due to https://github.com/import-js/eslint-plugin-import/issues/2675
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"graphql:generate:watch": "graphql-codegen-esm --watch",
"graphql:validate": "graphql-inspector validate --apollo '{pages,components}/**/*.vue' 'server/**/*.graphql'",
"docker:redis": "docker run -d --rm --name JabRefRedis -p 6380:6379 redis --requirepass jabref",
"lint": "pnpm lint:oxlint && pnpm lint:eslint && pnpm lint:prettier",
"lint": "pnpm lint:oxlint && pnpm lint:eslint && pnpm lint:oxfmt",
"lint:oxlint": "oxlint",
"lint:eslint": "eslint --report-unused-disable-directives .",
"lint:prettier": "prettier --check .",
"lint:oxfmt": "oxfmt --check",
"postinstall": "nuxi prepare && pnpm generate",
"test": "vitest",
"test:integration": "vitest --project integration",
Expand Down Expand Up @@ -135,10 +135,9 @@
"nuxt": "4.2.0",
"nuxt-auth-utils": "0.5.25",
"nuxt-graphql-server": "3.1.6",
"oxfmt": "^0.35.0",
"oxlint": "1.50.0",
"postinstall-postinstall": "2.1.0",
"prettier": "3.8.1",
"prettier-plugin-organize-imports": "4.3.0",
"prisma": "7.4.2",
"storybook": "10.2.13",
"storybook-vue-addon": "0.6.3",
Expand Down
Loading
Loading