Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Super simple JavaScript git diff hunk header config
*.js diff="javascript"
# In git config: .git/config, ~/.gitconfig, /etc/gitconfig
[diff "javascript"]
xfuncname = "^\\s*(.*?\\bfunction\\b.*?\\(.*?\\))"

eilgin commented Apr 23, 2017

Cool tip !
But this doesn't work for functions like this (ES2015 syntax):

class Foo {
  constructor () {
    this.bar = "baz"
  }

  getBar () {
    return this.bar
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment