Remove BiomeJS integration and improve task categorization in useTasks
- Removed BiomeJS configuration and replaced formatting script with ESLint in `package.json`. - Updated `useTasks` to utilize `@vueuse/core` methods for improved task categorization and unique category retrieval. - Simplified task grouping logic in `ListScreen`.
This commit is contained in:
41
biome.json
41
biome.json
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://biomejs.dev/schemas/2.4.2/schema.json",
|
|
||||||
"vcs": {
|
|
||||||
"enabled": true,
|
|
||||||
"clientKind": "git",
|
|
||||||
"useIgnoreFile": true
|
|
||||||
},
|
|
||||||
"files": {
|
|
||||||
"includes": ["**", "!!**/dist"]
|
|
||||||
},
|
|
||||||
"formatter": {
|
|
||||||
"enabled": true,
|
|
||||||
"indentStyle": "space",
|
|
||||||
"indentWidth": 2,
|
|
||||||
"lineWidth": 100
|
|
||||||
},
|
|
||||||
"linter": {
|
|
||||||
"enabled": true,
|
|
||||||
"rules": {
|
|
||||||
"recommended": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"javascript": {
|
|
||||||
"formatter": {
|
|
||||||
"quoteStyle": "double"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"assist": {
|
|
||||||
"enabled": true,
|
|
||||||
"actions": {
|
|
||||||
"source": {
|
|
||||||
"organizeImports": "on"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"css": {
|
|
||||||
"parser": {
|
|
||||||
"tailwindDirectives": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
"build:ios": "tauri ios build",
|
"build:ios": "tauri ios build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"tauri": "tauri",
|
"tauri": "tauri",
|
||||||
"format": "biome format --write"
|
"format": "eslint format --write"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@phosphor-icons/vue": "^2.2.1",
|
"@phosphor-icons/vue": "^2.2.1",
|
||||||
@@ -31,7 +31,6 @@
|
|||||||
"vue-router": "^4.6.4"
|
"vue-router": "^4.6.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "2.4.2",
|
|
||||||
"@tailwindcss/vite": "^4.2.0",
|
"@tailwindcss/vite": "^4.2.0",
|
||||||
"@tauri-apps/cli": "^2",
|
"@tauri-apps/cli": "^2",
|
||||||
"@vitejs/plugin-vue": "^6.0.4",
|
"@vitejs/plugin-vue": "^6.0.4",
|
||||||
|
|||||||
91
pnpm-lock.yaml
generated
91
pnpm-lock.yaml
generated
@@ -48,9 +48,6 @@ importers:
|
|||||||
specifier: ^4.6.4
|
specifier: ^4.6.4
|
||||||
version: 4.6.4(vue@3.5.28(typescript@5.9.3))
|
version: 4.6.4(vue@3.5.28(typescript@5.9.3))
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@biomejs/biome':
|
|
||||||
specifier: 2.4.2
|
|
||||||
version: 2.4.2
|
|
||||||
'@tailwindcss/vite':
|
'@tailwindcss/vite':
|
||||||
specifier: ^4.2.0
|
specifier: ^4.2.0
|
||||||
version: 4.2.0(vite@7.3.1(jiti@2.6.1)(lightningcss@1.31.1))
|
version: 4.2.0(vite@7.3.1(jiti@2.6.1)(lightningcss@1.31.1))
|
||||||
@@ -92,59 +89,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==}
|
resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|
||||||
'@biomejs/biome@2.4.2':
|
|
||||||
resolution: {integrity: sha512-vVE/FqLxNLbvYnFDYg3Xfrh1UdFhmPT5i+yPT9GE2nTUgI4rkqo5krw5wK19YHBd7aE7J6r91RRmb8RWwkjy6w==}
|
|
||||||
engines: {node: '>=14.21.3'}
|
|
||||||
hasBin: true
|
|
||||||
|
|
||||||
'@biomejs/cli-darwin-arm64@2.4.2':
|
|
||||||
resolution: {integrity: sha512-3pEcKCP/1POKyaZZhXcxFl3+d9njmeAihZ17k8lL/1vk+6e0Cbf0yPzKItFiT+5Yh6TQA4uKvnlqe0oVZwRxCA==}
|
|
||||||
engines: {node: '>=14.21.3'}
|
|
||||||
cpu: [arm64]
|
|
||||||
os: [darwin]
|
|
||||||
|
|
||||||
'@biomejs/cli-darwin-x64@2.4.2':
|
|
||||||
resolution: {integrity: sha512-P7hK1jLVny+0R9UwyGcECxO6sjETxfPyBm/1dmFjnDOHgdDPjPqozByunrwh4xPKld8sxOr5eAsSqal5uKgeBg==}
|
|
||||||
engines: {node: '>=14.21.3'}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [darwin]
|
|
||||||
|
|
||||||
'@biomejs/cli-linux-arm64-musl@2.4.2':
|
|
||||||
resolution: {integrity: sha512-/x04YK9+7erw6tYEcJv9WXoBHcULI/wMOvNdAyE9S3JStZZ9yJyV67sWAI+90UHuDo/BDhq0d96LDqGlSVv7WA==}
|
|
||||||
engines: {node: '>=14.21.3'}
|
|
||||||
cpu: [arm64]
|
|
||||||
os: [linux]
|
|
||||||
|
|
||||||
'@biomejs/cli-linux-arm64@2.4.2':
|
|
||||||
resolution: {integrity: sha512-DI3Mi7GT2zYNgUTDEbSjl3e1KhoP76OjQdm8JpvZYZWtVDRyLd3w8llSr2TWk1z+U3P44kUBWY3X7H9MD1/DGQ==}
|
|
||||||
engines: {node: '>=14.21.3'}
|
|
||||||
cpu: [arm64]
|
|
||||||
os: [linux]
|
|
||||||
|
|
||||||
'@biomejs/cli-linux-x64-musl@2.4.2':
|
|
||||||
resolution: {integrity: sha512-wbBmTkeAoAYbOQ33f6sfKG7pcRSydQiF+dTYOBjJsnXO2mWEOQHllKlC2YVnedqZFERp2WZhFUoO7TNRwnwEHQ==}
|
|
||||||
engines: {node: '>=14.21.3'}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [linux]
|
|
||||||
|
|
||||||
'@biomejs/cli-linux-x64@2.4.2':
|
|
||||||
resolution: {integrity: sha512-GK2ErnrKpWFigYP68cXiCHK4RTL4IUWhK92AFS3U28X/nuAL5+hTuy6hyobc8JZRSt+upXt1nXChK+tuHHx4mA==}
|
|
||||||
engines: {node: '>=14.21.3'}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [linux]
|
|
||||||
|
|
||||||
'@biomejs/cli-win32-arm64@2.4.2':
|
|
||||||
resolution: {integrity: sha512-k2uqwLYrNNxnaoiW3RJxoMGnbKda8FuCmtYG3cOtVljs3CzWxaTR+AoXwKGHscC9thax9R4kOrtWqWN0+KdPTw==}
|
|
||||||
engines: {node: '>=14.21.3'}
|
|
||||||
cpu: [arm64]
|
|
||||||
os: [win32]
|
|
||||||
|
|
||||||
'@biomejs/cli-win32-x64@2.4.2':
|
|
||||||
resolution: {integrity: sha512-9ma7C4g8Sq3cBlRJD2yrsHXB1mnnEBdpy7PhvFrylQWQb4PoyCmPucdX7frvsSBQuFtIiKCrolPl/8tCZrKvgQ==}
|
|
||||||
engines: {node: '>=14.21.3'}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [win32]
|
|
||||||
|
|
||||||
'@esbuild/aix-ppc64@0.27.3':
|
'@esbuild/aix-ppc64@0.27.3':
|
||||||
resolution: {integrity: sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==}
|
resolution: {integrity: sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
@@ -980,41 +924,6 @@ snapshots:
|
|||||||
'@babel/helper-string-parser': 7.27.1
|
'@babel/helper-string-parser': 7.27.1
|
||||||
'@babel/helper-validator-identifier': 7.28.5
|
'@babel/helper-validator-identifier': 7.28.5
|
||||||
|
|
||||||
'@biomejs/biome@2.4.2':
|
|
||||||
optionalDependencies:
|
|
||||||
'@biomejs/cli-darwin-arm64': 2.4.2
|
|
||||||
'@biomejs/cli-darwin-x64': 2.4.2
|
|
||||||
'@biomejs/cli-linux-arm64': 2.4.2
|
|
||||||
'@biomejs/cli-linux-arm64-musl': 2.4.2
|
|
||||||
'@biomejs/cli-linux-x64': 2.4.2
|
|
||||||
'@biomejs/cli-linux-x64-musl': 2.4.2
|
|
||||||
'@biomejs/cli-win32-arm64': 2.4.2
|
|
||||||
'@biomejs/cli-win32-x64': 2.4.2
|
|
||||||
|
|
||||||
'@biomejs/cli-darwin-arm64@2.4.2':
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@biomejs/cli-darwin-x64@2.4.2':
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@biomejs/cli-linux-arm64-musl@2.4.2':
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@biomejs/cli-linux-arm64@2.4.2':
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@biomejs/cli-linux-x64-musl@2.4.2':
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@biomejs/cli-linux-x64@2.4.2':
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@biomejs/cli-win32-arm64@2.4.2':
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@biomejs/cli-win32-x64@2.4.2':
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@esbuild/aix-ppc64@0.27.3':
|
'@esbuild/aix-ppc64@0.27.3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useApi } from './useApi.ts';
|
import { useApi } from './useApi.ts';
|
||||||
import { Task } from '../types.ts';
|
import { Task } from '../types.ts';
|
||||||
|
import { useArrayReduce, useArrayUnique } from '@vueuse/core'
|
||||||
|
|
||||||
const tasks = ref<Task[]>([]);
|
const tasks = ref<Task[]>([]);
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
@@ -75,6 +76,15 @@ export function useTasks() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tasksByCategory = useArrayReduce(tasks.value.sort((a,b) => a.id_ - b.id_), (acc, task) => {
|
||||||
|
const tag = task.tag ?? 'Uncategorized';
|
||||||
|
acc[tag] = acc[tag] ?? [];
|
||||||
|
acc[tag].push(task);
|
||||||
|
return acc;
|
||||||
|
}, {} as Record<string, Task[]>)
|
||||||
|
|
||||||
|
const categories = useArrayUnique(Object.keys(tasksByCategory.value))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
tasks,
|
tasks,
|
||||||
isLoading,
|
isLoading,
|
||||||
@@ -82,5 +92,6 @@ export function useTasks() {
|
|||||||
fetchTasks,
|
fetchTasks,
|
||||||
createTask,
|
createTask,
|
||||||
updateTask,
|
updateTask,
|
||||||
|
categories,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,12 +14,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
const visibleTasks = computed<Task[]>(() => tasks.value.filter(task => !task.archived))
|
const visibleTasks = computed<Task[]>(() => tasks.value.filter(task => !task.archived))
|
||||||
|
|
||||||
const categorizedTasks = computed(() => visibleTasks.value.reduce((acc, task) => {
|
const categorizedTasks = computed(() => visibleTasks.value.reduce())
|
||||||
const tag = task.tag ?? 'Uncategorized';
|
|
||||||
acc[tag] = acc[tag] ?? [];
|
|
||||||
acc[tag].push(task);
|
|
||||||
return acc;
|
|
||||||
}, {} as Record<string, Task[]>))
|
|
||||||
|
|
||||||
const collapsed = ref<string[]>([]);
|
const collapsed = ref<string[]>([]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user