Skip to content

JavaScript ast-grep rules to match assignment of function to pair#136

Merged
robmck1995 merged 1 commit into
agentic-labs:mainfrom
jy-tan:anon-fn
Jun 25, 2025
Merged

JavaScript ast-grep rules to match assignment of function to pair#136
robmck1995 merged 1 commit into
agentic-labs:mainfrom
jy-tan:anon-fn

Conversation

@jy-tan

@jy-tan jy-tan commented Jun 25, 2025

Copy link
Copy Markdown
Contributor

Previously ast-grep rules were not able to match these two cases:

module.exports.exampleFunc = function exampleFuncInner() {
  console.log("hello");
};

(exampleFuncInner would be matched, but we want exampleFunc)

module.exports.exampleFunc = () => {
  console.log("hello");
}

(wouldn't be matched)

Changes

  • Modify ast-grep rules
  • Add tests
  • Fix PHP tests failing

@robmck1995 robmck1995 merged commit 0b6242e into agentic-labs:main Jun 25, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants