- Build:
npm run buildorpnpm build(builds with Vite and copies assets to dist/) - No linting configured - ensure code follows TypeScript strict mode
- No testing framework - manually verify functionality in Logseq
- Group imports: external libraries first, then local imports with
@/alias - Use named imports for Logseq APIs:
import { ILSPluginUser } from "@logseq/libs/dist/LSPlugin" - Use
@/alias for src directory imports
- 2-space indentation (configured in .editorconfig)
- Trim trailing whitespace, insert final newlines
- Use single quotes for strings unless containing single quotes
- Variables/Functions: camelCase (
getSettings,handleEnter) - Files: kebab-case (
command.vue,up.ts) - Vue Components: PascalCase (
Command.vue) - TypeScript: Use explicit types, avoid
anyexcept for Logseq APIs - Interfaces: PascalCase with
Iprefix (ILSPluginUser)
- Use Composition API with
<script setup> - Use Pinia stores for state management (
useCommandStore()) - Use
ref()for reactive variables,computed()for derived state - Template refs with
$prefix ($input,$commandInput)
- Use try/catch for async operations
- Log errors with
console.error - Use Logseq's
logseq.UI.showMsg()for user notifications
- Prefer async/await over Promises
- Use
awaitfor all Logseq API calls - Handle rejections with
.catch(console.error)
- Register commands with
logseq.App.registerCommandPalette() - Use
@ts-ignorefor undocumented Logseq APIs - Access settings via
logseq.settings - Use
logseq.Editorfor block operations
- Use Tailwind CSS classes
- Component-scoped styles in
<style>blocks - Use Element Plus components with
el-prefix