longmo
3
总安装量
3
周安装量
#55083
全站排名
安装命令
npx skills add https://github.com/long36708/longmo-skills --skill longmo
Agent 安装分布
trae
3
codebuddy
3
roo
3
mcpjam
2
openhands
2
zencoder
2
Skill 文档
Longmo’s Preferences
| Category | Preference |
|---|---|
| Package Manager | pnpm (with @antfu/ni for unified commands) |
| Language | TypeScript (strict mode, ESM only) |
| Linting & Formatting | @antfu/eslint-config (no Prettier) + eslint-plugin-oxlint + commitlint |
| Testing | Vitest |
| Git Hooks | lefthook |
| Bundler (Libraries) | tsdown |
| Documentation | VitePress |
Core Conventions
@antfu/ni Commands
| Command | Description |
|---|---|
ni |
Install dependencies |
ni <pkg> / ni -D <pkg> |
Add dependency / dev dependency |
nr <script> |
Run script |
nu |
Upgrade dependencies |
nun <pkg> |
Uninstall dependency |
nci |
Clean install (pnpm i --frozen-lockfile) |
nlx <pkg> |
Execute package (npx) |
TypeScript Config
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
}
}
ESLint Setup
// eslint.config.mjs
import antfu from '@antfu/eslint-config'
import oxlint from 'eslint-plugin-oxlint'
export default [
...(await antfu({
vue: {
overrides: {
'vue/html-self-closing': 'off',
},
},
})),
...oxlint.configs['flat/all'],
]
Fix linting errors with nr lint --fix. Do NOT add a separate lint:fix script.
For detailed configuration options: antfu-eslint-config
Commit Message Guidelines
// commitlint.config.mjs
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'feat', // æ°åè½
'fix', // ä¿®å¤
'docs', // ææ¡£
'style', // ä»£ç æ ¼å¼ï¼ä¸å½±å代ç è¿è¡çåå¨ï¼
'refactor', // éæ
'perf', // æ§è½ä¼å
'test', // æµè¯
'chore', // æå»ºè¿ç¨æè¾
å©å·¥å
·çåå¨
'ci', // CIé
ç½®
'revert', // åæ»
'build', // æå»ºç³»ç»
],
],
'subject-case': [0], // ä¸éå¶ subject 大å°å
},
}
Lefthook Configuration
# Lefthook é
ç½®æä»¶
# åèï¼https://github.com/evilmartians/lefthook
pre-commit:
parallel: true
commands:
# æ ¼å¼ååæ£æ¥ Vue æä»¶
lint-vue:
glob: '*.vue'
run: pnpm exec eslint --cache --fix {staged_files}
fail_text: "ESLint æ£æ¥å¤±è´¥ï¼è¯·ä¿®å¤é误ååæäº¤"
# æ ¼å¼ååæ£æ¥ TypeScript/JavaScript æä»¶
lint-ts:
glob: '*.{ts,tsx,js,jsx}'
run: pnpm exec eslint --cache --fix {staged_files}
fail_text: "ESLint æ£æ¥å¤±è´¥ï¼è¯·ä¿®å¤é误ååæäº¤"
commit-msg:
commands:
commitlint:
run: pnpm exec commitlint --edit {1}
fail_text: "æäº¤ä¿¡æ¯ä¸ç¬¦åè§èï¼è¯·åè Conventional Commits è§è"
skip: 'git log -1 --pretty=%s | grep -q "\[skip ci\]"'
Git Hooks
{
"scripts": {
"prepare": "lefthook install"
}
}
å¡å¿ ç¨ lefthook æ´æ° pnpm-workspace.yaml onlyBuiltDependenciesï¼ å¹¶å¨æ ¹ package.json 䏿·»å lefthook pnpm.onlyBuiltDependenciesï¼ å¦ålefthookå çå®è£ åèæ¬ä¸ä¼è¢«æ§è¡ï¼é©åä¹ä¸ä¼è¢«å®è£ ã
Vitest Conventions
- Test files:
foo.tsâfoo.test.ts(same directory) - Use
describe/itAPI (nottest) - Use
toMatchSnapshotfor complex outputs - Use
toMatchFileSnapshotwith explicit path for language-specific snapshots
pnpm Catalogs
Use named catalogs in pnpm-workspace.yaml for version management:
| Catalog | Purpose |
|---|---|
prod |
Production dependencies |
inlined |
Bundler-inlined dependencies |
dev |
Dev tools (linter, bundler, testing) |
frontend |
Frontend libraries |
Avoid the default catalog. Catalog names can be adjusted per project needs.
References
| Topic | Description | Reference |
|---|---|---|
| ESLint Config | Framework support, formatters, rule overrides, VS Code settings | antfu-eslint-config |
| Project Setup | .gitignore, GitHub Actions, VS Code extensions | setting-up |
| App Development | Vue/Nuxt/UnoCSS conventions and patterns | app-development |
| Library Development | tsdown bundling, pure ESM publishing | library-development |
| Monorepo | pnpm workspaces, centralized alias, Turborepo | monorepo |