chore: migrate eslint and prettier to biome and fix all linting errors

This commit is contained in:
Samuel 2024-12-14 12:16:17 +01:00
parent 82413a8212
commit 9bcf233d2c
22 changed files with 397 additions and 481 deletions

13
.vscode/settings.json vendored
View file

@ -1,5 +1,12 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"typescript.inlayHints.parameterNames.enabled": "all"
}

196
biome.json Normal file
View file

@ -0,0 +1,196 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"formatter": {
"enabled": true,
"useEditorconfig": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 120,
"attributePosition": "multiline",
"bracketSpacing": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"complexity": {
"noExtraBooleanCast": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noStaticOnlyClass": "error",
"noUselessCatch": "error",
"noUselessConstructor": "error",
"noUselessTypeConstraint": "error",
"noWith": "error",
"useLiteralKeys": "error",
"useOptionalChain": "error"
},
"correctness": {
"noConstAssign": "error",
"noConstantCondition": "error",
"noEmptyCharacterClassInRegex": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInvalidBuiltinInstantiation": "error",
"noInvalidConstructorSuper": "error",
"noNonoctalDecimalEscape": "error",
"noPrecisionLoss": "error",
"noSelfAssign": "error",
"noSetterReturn": "error",
"noSwitchDeclarations": "error",
"noUndeclaredVariables": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnsafeOptionalChaining": "error",
"noUnusedLabels": "error",
"noUnusedPrivateClassMembers": "error",
"noUnusedVariables": "error",
"useArrayLiterals": "off",
"useIsNan": "error",
"useValidForDirection": "error",
"useYield": "error"
},
"style": {
"noInferrableTypes": "error",
"noNamespace": "error",
"noNonNullAssertion": "error",
"useAsConstAssertion": "error",
"useBlockStatements": "off",
"useConsistentArrayType": "error",
"useForOf": "error",
"useLiteralEnumMembers": "error",
"useShorthandFunctionType": "error"
},
"suspicious": {
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCompareNegZero": "error",
"noConfusingVoidType": "error",
"noControlCharactersInRegex": "error",
"noDebugger": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyBlockStatements": "error",
"noExplicitAny": "error",
"noExtraNonNullAssertion": "error",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noImportAssign": "error",
"noMisleadingCharacterClass": "error",
"noMisleadingInstantiator": "error",
"noPrototypeBuiltins": "error",
"noRedeclare": "error",
"noShadowRestrictedNames": "error",
"noSparseArray": "error",
"noUnsafeDeclarationMerging": "error",
"noUnsafeNegation": "error",
"useAwait": "error",
"useGetterReturn": "error",
"useNamespaceKeyword": "error",
"useValidTypeof": "error"
},
"nursery": {
"useSortedClasses": {
"level": "error",
"fix": "safe",
"options": {
"attributes": ["className"],
"functions": ["cn"]
}
}
}
},
"ignore": ["dist/**/*.ts", "dist/**", "**/*.mjs", "eslint.config.js", "**/*.js"]
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "all",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSameLine": false,
"quoteStyle": "double",
"attributePosition": "auto",
"bracketSpacing": true
},
"globals": []
},
"overrides": [
{
"include": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
"linter": {
"rules": {
"correctness": {
"noConstAssign": "off",
"noGlobalObjectCalls": "off",
"noInvalidBuiltinInstantiation": "off",
"noInvalidConstructorSuper": "off",
"noNewSymbol": "off",
"noSetterReturn": "off",
"noUndeclaredVariables": "off",
"noUnreachable": "off",
"noUnreachableSuper": "off"
},
"style": {
"noArguments": "error",
"noVar": "error",
"useConst": "error"
},
"suspicious": {
"noClassAssign": "off",
"noDuplicateClassMembers": "off",
"noDuplicateObjectKeys": "off",
"noDuplicateParameters": "off",
"noFunctionAssign": "off",
"noImportAssign": "off",
"noRedeclare": "off",
"noUnsafeNegation": "off",
"useGetterReturn": "off"
}
}
}
},
{
"include": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
"linter": {
"rules": {
"correctness": {
"noConstAssign": "off",
"noGlobalObjectCalls": "off",
"noInvalidBuiltinInstantiation": "off",
"noInvalidConstructorSuper": "off",
"noNewSymbol": "off",
"noSetterReturn": "off",
"noUndeclaredVariables": "off",
"noUnreachable": "off",
"noUnreachableSuper": "off"
},
"style": {
"noArguments": "error",
"noVar": "error",
"useConst": "error"
},
"suspicious": {
"noClassAssign": "off",
"noDuplicateClassMembers": "off",
"noDuplicateObjectKeys": "off",
"noDuplicateParameters": "off",
"noFunctionAssign": "off",
"noImportAssign": "off",
"noRedeclare": "off",
"noUnsafeNegation": "off",
"useGetterReturn": "off"
}
}
}
}
]
}

View file

@ -1,76 +0,0 @@
// @ts-check
import eslint from "@eslint/js";
import tsparser from "@typescript-eslint/parser";
import eslintConfigPrettier from "eslint-config-prettier";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import solid from "eslint-plugin-solid/configs/typescript";
import tseslint from "typescript-eslint";
export default tseslint.config(
{
ignores: ["dist/**/*.ts", "dist/**", "**/*.mjs", "eslint.config.js", "**/*.js"],
},
[
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
eslintPluginPrettierRecommended,
eslintConfigPrettier,
{
...solid,
languageOptions: {
parser: tsparser,
// Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2024,
// Allows for the parsing of modern ECMAScript features
sourceType: "module",
// Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
project: "./tsconfig.json",
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
"simple-import-sort": simpleImportSort,
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
"simple-import-sort/imports": [
"error",
{
groups: [
// solidjs
["^solid-(js|start)", "^@solidjs/"],
["^@?\\w"],
// components imports
["^~/components/?"],
// other /src imports
["^~/"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// types imports
["^~/types$"],
// Side effect imports.
["^\\u0000"],
// Style imports.
["^.+\\.?(s?css)$"],
],
},
],
"simple-import-sort/exports": "error",
// "@typescript-eslint/consistent-type-imports": "error",
// "@typescript-eslint/consistent-type-exports": "error",
},
},
],
);

View file

@ -13,6 +13,7 @@
},
"license": "MIT",
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@eslint/js": "^9.16.0",
"@types/node": "^22.10.1",
"@types/sql.js": "^1.4.9",
@ -20,15 +21,8 @@
"@typescript-eslint/parser": "^8.17.0",
"autoprefixer": "^10.4.20",
"better-sqlite3": "^11.7.0",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-solid": "^0.14.4",
"kysely-codegen": "^0.17.0",
"postcss": "^8.4.49",
"prettier": "^3.4.2",
"prettier-plugin-tailwindcss": "^0.6.9",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
"typescript-eslint": "^8.17.0",

303
pnpm-lock.yaml generated
View file

@ -66,6 +66,9 @@ importers:
specifier: ^1.0.7
version: 1.0.7(tailwindcss@3.4.16)
devDependencies:
'@biomejs/biome':
specifier: 1.9.4
version: 1.9.4
'@eslint/js':
specifier: ^9.16.0
version: 9.16.0
@ -87,33 +90,12 @@ importers:
better-sqlite3:
specifier: ^11.7.0
version: 11.7.0
eslint:
specifier: ^9.16.0
version: 9.16.0(jiti@1.21.6)
eslint-config-prettier:
specifier: ^9.1.0
version: 9.1.0(eslint@9.16.0(jiti@1.21.6))
eslint-plugin-prettier:
specifier: ^5.2.1
version: 5.2.1(eslint-config-prettier@9.1.0(eslint@9.16.0(jiti@1.21.6)))(eslint@9.16.0(jiti@1.21.6))(prettier@3.4.2)
eslint-plugin-simple-import-sort:
specifier: ^12.1.1
version: 12.1.1(eslint@9.16.0(jiti@1.21.6))
eslint-plugin-solid:
specifier: ^0.14.4
version: 0.14.4(eslint@9.16.0(jiti@1.21.6))(typescript@5.7.2)
kysely-codegen:
specifier: ^0.17.0
version: 0.17.0(better-sqlite3@11.7.0)(kysely@0.27.5)
postcss:
specifier: ^8.4.49
version: 8.4.49
prettier:
specifier: ^3.4.2
version: 3.4.2
prettier-plugin-tailwindcss:
specifier: ^0.6.9
version: 0.6.9(prettier@3.4.2)
tailwindcss:
specifier: ^3.4.16
version: 3.4.16
@ -217,6 +199,59 @@ packages:
resolution: {integrity: sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==}
engines: {node: '>=6.9.0'}
'@biomejs/biome@1.9.4':
resolution: {integrity: sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==}
engines: {node: '>=14.21.3'}
hasBin: true
'@biomejs/cli-darwin-arm64@1.9.4':
resolution: {integrity: sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==}
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [darwin]
'@biomejs/cli-darwin-x64@1.9.4':
resolution: {integrity: sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [darwin]
'@biomejs/cli-linux-arm64-musl@1.9.4':
resolution: {integrity: sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==}
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [linux]
'@biomejs/cli-linux-arm64@1.9.4':
resolution: {integrity: sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==}
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [linux]
'@biomejs/cli-linux-x64-musl@1.9.4':
resolution: {integrity: sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [linux]
'@biomejs/cli-linux-x64@1.9.4':
resolution: {integrity: sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [linux]
'@biomejs/cli-win32-arm64@1.9.4':
resolution: {integrity: sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==}
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [win32]
'@biomejs/cli-win32-x64@1.9.4':
resolution: {integrity: sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [win32]
'@corvu/utils@0.4.2':
resolution: {integrity: sha512-Ox2kYyxy7NoXdKWdHeDEjZxClwzO4SKM8plAaVwmAJPxHMqA0rLOoAsa+hBDwRLpctf+ZRnAd/ykguuJidnaTA==}
peerDependencies:
@ -491,10 +526,6 @@ packages:
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
engines: {node: '>=14'}
'@pkgr/core@0.1.1':
resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==}
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
'@rollup/rollup-android-arm-eabi@4.28.1':
resolution: {integrity: sha512-2aZp8AES04KI2dy3Ss6/MDjXbwBzj+i0GqKtWXgw2/Ma6E4jJvujryO6gJAghIRVz7Vwr9Gtl/8na3nDUKpraQ==}
cpu: [arm]
@ -1035,37 +1066,6 @@ packages:
resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
engines: {node: '>=10'}
eslint-config-prettier@9.1.0:
resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==}
hasBin: true
peerDependencies:
eslint: '>=7.0.0'
eslint-plugin-prettier@5.2.1:
resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==}
engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies:
'@types/eslint': '>=8.0.0'
eslint: '>=8.0.0'
eslint-config-prettier: '*'
prettier: '>=3.0.0'
peerDependenciesMeta:
'@types/eslint':
optional: true
eslint-config-prettier:
optional: true
eslint-plugin-simple-import-sort@12.1.1:
resolution: {integrity: sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==}
peerDependencies:
eslint: '>=5.0.0'
eslint-plugin-solid@0.14.4:
resolution: {integrity: sha512-uWsNA2okBgwBRPxjsQ7DxlRksq1EKdMhwQlViHdkkRDLnWqwnZEjQASWeckZ0DI24sVzPeETJhPv1BWKKiu99A==}
engines: {node: '>=18.0.0'}
peerDependencies:
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0
eslint-scope@8.2.0:
resolution: {integrity: sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@ -1115,9 +1115,6 @@ packages:
fast-deep-equal@3.1.3:
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
fast-diff@1.3.0:
resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==}
fast-glob@3.3.2:
resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==}
engines: {node: '>=8.6.0'}
@ -1231,10 +1228,6 @@ packages:
html-entities@2.3.3:
resolution: {integrity: sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==}
html-tags@3.3.1:
resolution: {integrity: sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==}
engines: {node: '>=8'}
ieee754@1.2.1:
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
@ -1260,9 +1253,6 @@ packages:
ini@1.3.8:
resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
inline-style-parser@0.2.4:
resolution: {integrity: sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==}
interpret@1.4.0:
resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==}
engines: {node: '>= 0.10'}
@ -1287,10 +1277,6 @@ packages:
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
engines: {node: '>=0.10.0'}
is-html@2.0.0:
resolution: {integrity: sha512-S+OpgB5i7wzIue/YSE5hg0e5ZYfG3hhpNh9KGl6ayJ38p7ED6wxQLd1TV91xHpcTvw90KMJ9EwN3F/iNflHBVg==}
engines: {node: '>=8'}
is-number@7.0.0:
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
engines: {node: '>=0.12.0'}
@ -1335,15 +1321,9 @@ packages:
engines: {node: '>=6'}
hasBin: true
kebab-case@1.0.2:
resolution: {integrity: sha512-7n6wXq4gNgBELfDCpzKc+mRrZFs7D+wgfF5WRFLNAr4DA/qtr9Js8uOAVAfHhuLMfAcQ0pRKqbpjx+TcJVdE1Q==}
keyv@4.5.4:
resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==}
known-css-properties@0.30.0:
resolution: {integrity: sha512-VSWXYUnsPu9+WYKkfmJyLKtIvaRJi1kXUqVmBACORXZQxT5oZDsoZ2vQP+bQFDnWtpI/4eq3MLoRMjI2fnLzTQ==}
kysely-codegen@0.17.0:
resolution: {integrity: sha512-C36g6epial8cIOSBEWGI9sRfkKSsEzTcivhjPivtYFQnhMdXnrVFaUe7UMZHeSdXaHiWDqDOkReJgWLD8nPKdg==}
hasBin: true
@ -1606,70 +1586,6 @@ packages:
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
engines: {node: '>= 0.8.0'}
prettier-linter-helpers@1.0.0:
resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==}
engines: {node: '>=6.0.0'}
prettier-plugin-tailwindcss@0.6.9:
resolution: {integrity: sha512-r0i3uhaZAXYP0At5xGfJH876W3HHGHDp+LCRUJrs57PBeQ6mYHMwr25KH8NPX44F2yGTvdnH7OqCshlQx183Eg==}
engines: {node: '>=14.21.3'}
peerDependencies:
'@ianvs/prettier-plugin-sort-imports': '*'
'@prettier/plugin-pug': '*'
'@shopify/prettier-plugin-liquid': '*'
'@trivago/prettier-plugin-sort-imports': '*'
'@zackad/prettier-plugin-twig-melody': '*'
prettier: ^3.0
prettier-plugin-astro: '*'
prettier-plugin-css-order: '*'
prettier-plugin-import-sort: '*'
prettier-plugin-jsdoc: '*'
prettier-plugin-marko: '*'
prettier-plugin-multiline-arrays: '*'
prettier-plugin-organize-attributes: '*'
prettier-plugin-organize-imports: '*'
prettier-plugin-sort-imports: '*'
prettier-plugin-style-order: '*'
prettier-plugin-svelte: '*'
peerDependenciesMeta:
'@ianvs/prettier-plugin-sort-imports':
optional: true
'@prettier/plugin-pug':
optional: true
'@shopify/prettier-plugin-liquid':
optional: true
'@trivago/prettier-plugin-sort-imports':
optional: true
'@zackad/prettier-plugin-twig-melody':
optional: true
prettier-plugin-astro:
optional: true
prettier-plugin-css-order:
optional: true
prettier-plugin-import-sort:
optional: true
prettier-plugin-jsdoc:
optional: true
prettier-plugin-marko:
optional: true
prettier-plugin-multiline-arrays:
optional: true
prettier-plugin-organize-attributes:
optional: true
prettier-plugin-organize-imports:
optional: true
prettier-plugin-sort-imports:
optional: true
prettier-plugin-style-order:
optional: true
prettier-plugin-svelte:
optional: true
prettier@3.4.2:
resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==}
engines: {node: '>=14'}
hasBin: true
pump@3.0.2:
resolution: {integrity: sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==}
@ -1820,9 +1736,6 @@ packages:
resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
engines: {node: '>=8'}
style-to-object@1.0.8:
resolution: {integrity: sha512-xT47I/Eo0rwJmaXC4oilDGDWLohVhR6o/xAQcPQN8q6QBuZVL8qMYL85kLmST5cPjAorwvqIA4qXTRQoYHaL6g==}
sucrase@3.35.0:
resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==}
engines: {node: '>=16 || 14 >=14.17'}
@ -1840,10 +1753,6 @@ packages:
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
engines: {node: '>= 0.4'}
synckit@0.9.2:
resolution: {integrity: sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==}
engines: {node: ^14.18.0 || >=16.0.0}
tailwind-merge@2.5.5:
resolution: {integrity: sha512-0LXunzzAZzo0tEPxV3I297ffKZPlKDrjj7NXphC8V5ak9yHC5zRmxnOe2m/Rd/7ivsOMJe3JZ2JVocoDdQTRBA==}
@ -2135,6 +2044,41 @@ snapshots:
'@babel/helper-string-parser': 7.25.9
'@babel/helper-validator-identifier': 7.25.9
'@biomejs/biome@1.9.4':
optionalDependencies:
'@biomejs/cli-darwin-arm64': 1.9.4
'@biomejs/cli-darwin-x64': 1.9.4
'@biomejs/cli-linux-arm64': 1.9.4
'@biomejs/cli-linux-arm64-musl': 1.9.4
'@biomejs/cli-linux-x64': 1.9.4
'@biomejs/cli-linux-x64-musl': 1.9.4
'@biomejs/cli-win32-arm64': 1.9.4
'@biomejs/cli-win32-x64': 1.9.4
'@biomejs/cli-darwin-arm64@1.9.4':
optional: true
'@biomejs/cli-darwin-x64@1.9.4':
optional: true
'@biomejs/cli-linux-arm64-musl@1.9.4':
optional: true
'@biomejs/cli-linux-arm64@1.9.4':
optional: true
'@biomejs/cli-linux-x64-musl@1.9.4':
optional: true
'@biomejs/cli-linux-x64@1.9.4':
optional: true
'@biomejs/cli-win32-arm64@1.9.4':
optional: true
'@biomejs/cli-win32-x64@1.9.4':
optional: true
'@corvu/utils@0.4.2(solid-js@1.9.3)':
dependencies:
'@floating-ui/dom': 1.6.12
@ -2355,8 +2299,6 @@ snapshots:
'@pkgjs/parseargs@0.11.0':
optional: true
'@pkgr/core@0.1.1': {}
'@rollup/rollup-android-arm-eabi@4.28.1':
optional: true
@ -2889,36 +2831,6 @@ snapshots:
escape-string-regexp@4.0.0: {}
eslint-config-prettier@9.1.0(eslint@9.16.0(jiti@1.21.6)):
dependencies:
eslint: 9.16.0(jiti@1.21.6)
eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@9.16.0(jiti@1.21.6)))(eslint@9.16.0(jiti@1.21.6))(prettier@3.4.2):
dependencies:
eslint: 9.16.0(jiti@1.21.6)
prettier: 3.4.2
prettier-linter-helpers: 1.0.0
synckit: 0.9.2
optionalDependencies:
eslint-config-prettier: 9.1.0(eslint@9.16.0(jiti@1.21.6))
eslint-plugin-simple-import-sort@12.1.1(eslint@9.16.0(jiti@1.21.6)):
dependencies:
eslint: 9.16.0(jiti@1.21.6)
eslint-plugin-solid@0.14.4(eslint@9.16.0(jiti@1.21.6))(typescript@5.7.2):
dependencies:
'@typescript-eslint/utils': 8.17.0(eslint@9.16.0(jiti@1.21.6))(typescript@5.7.2)
eslint: 9.16.0(jiti@1.21.6)
estraverse: 5.3.0
is-html: 2.0.0
kebab-case: 1.0.2
known-css-properties: 0.30.0
style-to-object: 1.0.8
transitivePeerDependencies:
- supports-color
- typescript
eslint-scope@8.2.0:
dependencies:
esrecurse: 4.3.0
@ -2991,8 +2903,6 @@ snapshots:
fast-deep-equal@3.1.3: {}
fast-diff@1.3.0: {}
fast-glob@3.3.2:
dependencies:
'@nodelib/fs.stat': 2.0.5
@ -3103,8 +3013,6 @@ snapshots:
html-entities@2.3.3: {}
html-tags@3.3.1: {}
ieee754@1.2.1: {}
ignore@5.3.2: {}
@ -3125,8 +3033,6 @@ snapshots:
ini@1.3.8: {}
inline-style-parser@0.2.4: {}
interpret@1.4.0: {}
is-binary-path@2.1.0:
@ -3145,10 +3051,6 @@ snapshots:
dependencies:
is-extglob: 2.1.1
is-html@2.0.0:
dependencies:
html-tags: 3.3.1
is-number@7.0.0: {}
is-what@4.1.16: {}
@ -3179,14 +3081,10 @@ snapshots:
json5@2.2.3: {}
kebab-case@1.0.2: {}
keyv@4.5.4:
dependencies:
json-buffer: 3.0.1
known-css-properties@0.30.0: {}
kysely-codegen@0.17.0(better-sqlite3@11.7.0)(kysely@0.27.5):
dependencies:
chalk: 4.1.2
@ -3396,16 +3294,6 @@ snapshots:
prelude-ls@1.2.1: {}
prettier-linter-helpers@1.0.0:
dependencies:
fast-diff: 1.3.0
prettier-plugin-tailwindcss@0.6.9(prettier@3.4.2):
dependencies:
prettier: 3.4.2
prettier@3.4.2: {}
pump@3.0.2:
dependencies:
end-of-stream: 1.4.4
@ -3572,10 +3460,6 @@ snapshots:
strip-json-comments@3.1.1: {}
style-to-object@1.0.8:
dependencies:
inline-style-parser: 0.2.4
sucrase@3.35.0:
dependencies:
'@jridgewell/gen-mapping': 0.3.5
@ -3596,11 +3480,6 @@ snapshots:
supports-preserve-symlinks-flag@1.0.0: {}
synckit@0.9.2:
dependencies:
'@pkgr/core': 0.1.1
tslib: 2.8.1
tailwind-merge@2.5.5: {}
tailwindcss-animate@1.0.7(tailwindcss@3.4.16):

View file

@ -1,9 +0,0 @@
export default {
semi: true,
trailingComma: "all",
singleQuote: false,
printWidth: 120,
tabWidth: 2,
singleAttributePerLine: true,
plugins: ["prettier-plugin-tailwindcss"],
};

View file

@ -9,22 +9,10 @@ import "./app.css";
const App: Component = () => {
return (
<>
<Route
path="/"
component={Home}
/>
<Route
path="/overview"
component={Overview}
/>
<Route
path="/dm/:dmid"
component={DmId}
/>
<Route
path="/group/:groupid"
component={GroupId}
/>
<Route path="/" component={Home} />
<Route path="/overview" component={Overview} />
<Route path="/dm/:dmid" component={DmId} />
<Route path="/group/:groupid" component={GroupId} />
<Route
path="/test"
component={() => {

View file

@ -101,9 +101,7 @@
}
body {
@apply bg-background text-foreground;
font-feature-settings:
"rlig" 1,
"calt" 1;
font-feature-settings: "rlig" 1, "calt" 1;
}
}

View file

@ -94,8 +94,11 @@ const BaseChart: Component<ChartProps> = (rawProps) => {
on(
() => props.data,
() => {
chart()!.data = props.data;
chart()!.update();
const currentChart = chart();
if (currentChart) {
currentChart.data = props.data;
currentChart.update();
}
},
{ defer: true },
),
@ -105,8 +108,11 @@ const BaseChart: Component<ChartProps> = (rawProps) => {
on(
() => props.options,
() => {
chart()!.options = props.options;
chart()!.update();
const currentChart = chart();
if (currentChart) {
currentChart.options = props.options;
currentChart.update();
}
},
{ defer: true },
),
@ -116,7 +122,10 @@ const BaseChart: Component<ChartProps> = (rawProps) => {
on(
[() => props.width, () => props.height],
() => {
chart()!.resize(props.width, props.height);
const currentChart = chart();
if (currentChart) {
currentChart.resize(props.width, props.height);
}
},
{ defer: true },
),
@ -126,10 +135,13 @@ const BaseChart: Component<ChartProps> = (rawProps) => {
on(
() => props.type,
() => {
const dimensions = [chart()!.width, chart()!.height];
chart()!.destroy();
init();
chart()!.resize(...dimensions);
const currentChart = chart();
if (currentChart) {
const dimensions = [currentChart.width, currentChart.height];
currentChart.destroy();
init();
currentChart.resize(...dimensions);
}
},
{ defer: true },
),
@ -141,13 +153,7 @@ const BaseChart: Component<ChartProps> = (rawProps) => {
});
Chart.register(Colors, Filler, Legend, Tooltip);
return (
<canvas
ref={mergeRefs(props.ref, (el) => setCanvasRef(el))}
height={props.height}
width={props.width}
/>
);
return <canvas ref={mergeRefs(props.ref, (el) => setCanvasRef(el))} height={props.height} width={props.width} />;
};
function showTooltip(context: ChartContext) {
@ -245,13 +251,7 @@ function createTypedChart(type: ChartType, components: ChartComponent[]): Compon
};
Chart.register(...components);
return (props) => (
<BaseChart
type={type}
options={options}
{...props}
/>
);
return (props) => <BaseChart type={type} options={options} {...props} />;
}
const BarChart = /* #__PURE__ */ createTypedChart("bar", [BarController, BarElement, CategoryScale, LinearScale]);

View file

@ -13,10 +13,7 @@ type CheckboxRootProps<T extends ValidComponent = "div"> = CheckboxPrimitive.Che
const Checkbox = <T extends ValidComponent = "div">(props: PolymorphicProps<T, CheckboxRootProps<T>>) => {
const [local, others] = splitProps(props as CheckboxRootProps, ["class"]);
return (
<CheckboxPrimitive.Root
class={cn("items-top group relative flex space-x-2", local.class)}
{...others}
>
<CheckboxPrimitive.Root class={cn("items-top group relative flex space-x-2", local.class)} {...others}>
<CheckboxPrimitive.Input class="peer" />
<CheckboxPrimitive.Control class="size-4 shrink-0 rounded-sm border border-primary ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2 data-[checked]:border-none data-[indeterminate]:border-none data-[checked]:bg-primary data-[indeterminate]:bg-primary data-[checked]:text-primary-foreground data-[indeterminate]:text-primary-foreground">
<CheckboxPrimitive.Indicator>

View file

@ -8,7 +8,7 @@ const Label: Component<ComponentProps<"label">> = (props) => {
return (
<label
class={cn(
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
"font-medium text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
local.class,
)}
{...others}

View file

@ -7,42 +7,24 @@ const Table: Component<ComponentProps<"table">> = (props) => {
const [local, others] = splitProps(props, ["class"]);
return (
<div class="relative w-full overflow-auto">
<table
class={cn("w-full caption-bottom text-sm", local.class)}
{...others}
/>
<table class={cn("w-full caption-bottom text-sm", local.class)} {...others} />
</div>
);
};
const TableHeader: Component<ComponentProps<"thead">> = (props) => {
const [local, others] = splitProps(props, ["class"]);
return (
<thead
class={cn("[&_tr]:border-b", local.class)}
{...others}
/>
);
return <thead class={cn("[&_tr]:border-b", local.class)} {...others} />;
};
const TableBody: Component<ComponentProps<"tbody">> = (props) => {
const [local, others] = splitProps(props, ["class"]);
return (
<tbody
class={cn("[&_tr:last-child]:border-0", local.class)}
{...others}
/>
);
return <tbody class={cn("[&_tr:last-child]:border-0", local.class)} {...others} />;
};
const TableFooter: Component<ComponentProps<"tfoot">> = (props) => {
const [local, others] = splitProps(props, ["class"]);
return (
<tfoot
class={cn("bg-primary font-medium text-primary-foreground", local.class)}
{...others}
/>
);
return <tfoot class={cn("bg-primary font-medium text-primary-foreground", local.class)} {...others} />;
};
const TableRow: Component<ComponentProps<"tr">> = (props) => {
@ -70,22 +52,12 @@ const TableHead: Component<ComponentProps<"th">> = (props) => {
const TableCell: Component<ComponentProps<"td">> = (props) => {
const [local, others] = splitProps(props, ["class"]);
return (
<td
class={cn("p-2 align-middle [&:has([role=checkbox])]:pr-0", local.class)}
{...others}
/>
);
return <td class={cn("p-2 align-middle [&:has([role=checkbox])]:pr-0", local.class)} {...others} />;
};
const TableCaption: Component<ComponentProps<"caption">> = (props) => {
const [local, others] = splitProps(props, ["class"]);
return (
<caption
class={cn("mt-4 text-sm text-muted-foreground", local.class)}
{...others}
/>
);
return <caption class={cn("mt-4 text-muted-foreground text-sm", local.class)} {...others} />;
};
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };

View file

@ -13,12 +13,7 @@ type TextFieldRootProps<T extends ValidComponent = "div"> = TextFieldPrimitive.T
const TextField = <T extends ValidComponent = "div">(props: PolymorphicProps<T, TextFieldRootProps<T>>) => {
const [local, others] = splitProps(props as TextFieldRootProps, ["class"]);
return (
<TextFieldPrimitive.Root
class={cn("flex flex-col gap-1", local.class)}
{...others}
/>
);
return <TextFieldPrimitive.Root class={cn("flex flex-col gap-1", local.class)} {...others} />;
};
type TextFieldInputProps<T extends ValidComponent = "input"> = TextFieldPrimitive.TextFieldInputProps<T> & {
@ -55,7 +50,7 @@ const TextFieldInput = <T extends ValidComponent = "input">(rawProps: Polymorphi
<TextFieldPrimitive.Input
type={local.type}
class={cn(
"flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[invalid]:border-error-foreground data-[invalid]:text-error-foreground",
"flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[invalid]:border-error-foreground data-[invalid]:text-error-foreground",
local.class,
)}
{...others}
@ -104,12 +99,7 @@ type TextFieldLabelProps<T extends ValidComponent = "label"> = TextFieldPrimitiv
const TextFieldLabel = <T extends ValidComponent = "label">(props: PolymorphicProps<T, TextFieldLabelProps<T>>) => {
const [local, others] = splitProps(props as TextFieldLabelProps, ["class"]);
return (
<TextFieldPrimitive.Label
class={cn(labelVariants(), local.class)}
{...others}
/>
);
return <TextFieldPrimitive.Label class={cn(labelVariants(), local.class)} {...others} />;
};
type TextFieldDescriptionProps<T extends ValidComponent = "div"> = TextFieldPrimitive.TextFieldDescriptionProps<T> & {
@ -121,10 +111,7 @@ const TextFieldDescription = <T extends ValidComponent = "div">(
) => {
const [local, others] = splitProps(props as TextFieldDescriptionProps, ["class"]);
return (
<TextFieldPrimitive.Description
class={cn(labelVariants({ variant: "description" }), local.class)}
{...others}
/>
<TextFieldPrimitive.Description class={cn(labelVariants({ variant: "description" }), local.class)} {...others} />
);
};
@ -136,12 +123,7 @@ const TextFieldErrorMessage = <T extends ValidComponent = "div">(
props: PolymorphicProps<T, TextFieldErrorMessageProps<T>>,
) => {
const [local, others] = splitProps(props as TextFieldErrorMessageProps, ["class"]);
return (
<TextFieldPrimitive.ErrorMessage
class={cn(labelVariants({ variant: "error" }), local.class)}
{...others}
/>
);
return <TextFieldPrimitive.ErrorMessage class={cn(labelVariants({ variant: "error" }), local.class)} {...others} />;
};
export { TextField, TextFieldDescription, TextFieldErrorMessage, TextFieldInput, TextFieldLabel, TextFieldTextArea };

View file

@ -90,6 +90,7 @@ const allThreadsOverviewQueryRaw = kyselyDb()
"groups.title",
"message_count",
"thread.date as last_message_date",
"recipient.nickname_joined_name",
])
.where("message_count", ">", 0)
.$narrowType<{
@ -119,7 +120,12 @@ export const overallSentMessagesQuery = cached(overallSentMessagesQueryRaw);
const dmPartnerRecipientQueryRaw = (dmId: number) =>
kyselyDb()
.selectFrom("recipient")
.select(["recipient._id", "recipient.system_joined_name", "recipient.profile_joined_name"])
.select([
"recipient._id",
"recipient.system_joined_name",
"recipient.profile_joined_name",
"recipient.nickname_joined_name",
])
.innerJoin("thread", "recipient._id", "thread.recipient_id")
.where((eb) => eb.and([eb("thread._id", "=", dmId), eb("recipient._id", "!=", SELF_ID)]))
.$narrowType<{

View file

@ -0,0 +1,17 @@
export const getNameFromRecipient = (
joinedNickname: string | null,
joinedSystemName: string | null,
joinedProfileName: string | null,
) => {
let name = "Could not determine name";
if (joinedNickname !== null) {
name = joinedNickname;
} else if (joinedSystemName !== null && joinedSystemName !== "") {
name = joinedSystemName;
} else if (joinedProfileName !== null) {
name = joinedProfileName;
}
return name;
};

View file

@ -6,6 +6,7 @@ import { type ChartData } from "chart.js";
import { LineChart, WordCloudChart } from "~/components/ui/charts";
import { dmPartnerRecipientQuery, dmSentMessagesPerPersonOverviewQuery, SELF_ID, threadMostUsedWordsQuery } from "~/db";
import { getNameFromRecipient } from "~/lib/getNameFromRecipient";
export const DmId: Component<RouteSectionProps> = (props) => {
const dmId = () => Number(props.params.dmid);
@ -17,10 +18,11 @@ export const DmId: Component<RouteSectionProps> = (props) => {
if (dmPartner) {
return {
id: dmPartner._id,
name: /* can be empty string */ !dmPartner.system_joined_name
? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
dmPartner.profile_joined_name!
: dmPartner.system_joined_name,
name: getNameFromRecipient(
dmPartner.nickname_joined_name,
dmPartner.system_joined_name,
dmPartner.profile_joined_name,
),
};
}
});

View file

@ -3,6 +3,8 @@ import type { RouteSectionProps } from "@solidjs/router";
export const GroupId: Component<RouteSectionProps> = (props) => {
const groupId = () => Number(props.params.groupid);
return groupId();
};
export default GroupId;

View file

@ -23,11 +23,7 @@ export const Home: Component<RouteSectionProps> = () => {
return (
<div>
<input
type="file"
accept=".sqlite"
onChange={onFileChange}
></input>
<input type="file" accept=".sqlite" onChange={onFileChange}></input>
</div>
);
};

View file

@ -4,6 +4,7 @@ import type { RouteSectionProps } from "@solidjs/router";
import { allThreadsOverviewQuery, overallSentMessagesQuery, SELF_ID } from "~/db";
import { OverviewTable, type RoomOverview } from "./overview-table";
import { getNameFromRecipient } from "~/lib/getNameFromRecipient";
export const Overview: Component<RouteSectionProps> = () => {
const [allSelfSentMessagesCount] = createResource(() => overallSentMessagesQuery(SELF_ID));
@ -12,14 +13,13 @@ export const Overview: Component<RouteSectionProps> = () => {
return (await allThreadsOverviewQuery()).rows.map((row) => {
const isGroup = row.title !== null;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const name = (
isGroup
? row.title
: /* seems possible that it is an empty string */ !row.system_joined_name
? row.profile_joined_name
: row.system_joined_name
)!;
let name = "";
if (row.title !== null) {
name = row.title;
} else {
name = getNameFromRecipient(row.nickname_joined_name, row.system_joined_name, row.profile_joined_name);
}
return {
threadId: row.thread_id,
@ -36,12 +36,8 @@ export const Overview: Component<RouteSectionProps> = () => {
return (
<div>
<p>All messages: {allSelfSentMessagesCount()?.messageCount as number}</p>
<Show
when={!roomOverview.loading}
fallback="Loading..."
>
{/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */}
<OverviewTable data={roomOverview()!} />;
<Show when={!roomOverview.loading && roomOverview()} fallback="Loading...">
{(currentRoomOverview) => <OverviewTable data={currentRoomOverview()} />}
</Show>
</div>
);

View file

@ -76,11 +76,7 @@ export const columns = [
}}
>
Name
<SortingDisplay
sorting={sorting()}
class="ml-2 h-4 w-4"
activeClass="text-info-foreground"
/>
<SortingDisplay sorting={sorting()} class="ml-2 h-4 w-4" activeClass="text-info-foreground" />
</Button>
);
},
@ -94,18 +90,12 @@ export const columns = [
<Show when={isArchived || isGroup}>
<div class="ml-auto flex flex-row gap-2">
<Show when={isArchived}>
<Badge
variant="outline"
class="ml-auto"
>
<Badge variant="outline" class="ml-auto">
Archived
</Badge>
</Show>
<Show when={isGroup}>
<Badge
variant="outline"
class="ml-auto"
>
<Badge variant="outline" class="ml-auto">
Group
</Badge>
</Show>
@ -128,11 +118,7 @@ export const columns = [
}}
>
Number of messages
<SortingDisplay
sorting={sorting()}
class="ml-2 h-4 w-4"
activeClass="text-info-foreground"
/>
<SortingDisplay sorting={sorting()} class="ml-2 h-4 w-4" activeClass="text-info-foreground" />
</Button>
);
},
@ -150,11 +136,7 @@ export const columns = [
}}
>
Date of last message
<SortingDisplay
sorting={sorting()}
class="ml-2 h-4 w-4"
activeClass="text-info-foreground"
/>
<SortingDisplay sorting={sorting()} class="ml-2 h-4 w-4" activeClass="text-info-foreground" />
</Button>
);
},
@ -252,10 +234,7 @@ export const OverviewTable = (props: OverviewTableProps) => {
value={(table.getColumn("name")?.getFilterValue() as string | undefined) ?? ""}
onChange={(value) => table.getColumn("name")?.setFilterValue(value)}
>
<TextFieldInput
placeholder="Filter by name..."
class="max-w-sm"
/>
<TextFieldInput placeholder="Filter by name..." class="max-w-sm" />
</TextField>
</div>
<div class="flex items-start space-x-2">
@ -277,7 +256,7 @@ export const OverviewTable = (props: OverviewTableProps) => {
<For each={headerGroup.headers}>
{(header) => (
<TableHead
class="border-b border-r border-t first-of-type:rounded-tl-md first-of-type:border-l last-of-type:rounded-tr-md"
class="border-t border-r border-b first-of-type:rounded-tl-md first-of-type:border-l last-of-type:rounded-tr-md"
colSpan={header.colSpan}
>
<Show when={!header.isPlaceholder}>
@ -297,7 +276,7 @@ export const OverviewTable = (props: OverviewTableProps) => {
<TableRow>
<TableCell
colSpan={columns.length}
class="h-24 border-b border-r text-center first-of-type:rounded-tl-md first-of-type:border-l last-of-type:rounded-br-md"
class="h-24 border-r border-b text-center first-of-type:rounded-tl-md first-of-type:border-l last-of-type:rounded-br-md"
>
No results.
</TableCell>
@ -318,7 +297,7 @@ export const OverviewTable = (props: OverviewTableProps) => {
>
<For each={row.getVisibleCells()}>
{(cell) => (
<TableCell class="border-b border-r first-of-type:border-l">
<TableCell class="border-r border-b first-of-type:border-l">
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</TableCell>
)}

View file

@ -8,23 +8,13 @@
"esModuleInterop": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"types": [
"vite/client"
],
"types": ["vite/client"],
"noEmit": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"baseUrl": ".",
"paths": {
"~/*": [
"./src/*"
]
},
},
// "files": [
// "./eslint.config.js",
// "./prettier.config.js",
// "./tailwind.config.js",
// "./postcss.config.js",
// ]
}
"~/*": ["./src/*"]
}
}
}

View file

@ -10,4 +10,4 @@
"components": "~/components/ui",
"utils": "~/lib/utils"
}
}
}