feat: implicit return for single expressions using acorn parser

- Parse code with acorn to detect single expression statements
- Auto-wrap expressions with 'return await (...)' for implicit return
- Exclude side-effects: assignments, updates (x++), delete operator
- Update skill.md examples to remove console.log (keep await)
- Add unit tests for shouldAutoReturn function
This commit is contained in:
Tommy D. Rossi
2026-02-04 11:23:39 +01:00
parent 26ddeb2a7b
commit bd38ba0532
5 changed files with 160 additions and 7 deletions
+3
View File
@@ -86,6 +86,9 @@ importers:
'@xmorse/cac':
specifier: ^6.0.7
version: 6.0.7
acorn:
specifier: ^8.15.0
version: 8.15.0
async-sema:
specifier: ^3.1.1
version: 3.1.1