Skip to content

Instantly share code, notes, and snippets.

@tlrobinson
Created April 14, 2017 22:32
Show Gist options
  • Save tlrobinson/41bbe51c77b4f3f0b185a163a90ed608 to your computer and use it in GitHub Desktop.
Save tlrobinson/41bbe51c77b4f3f0b185a163a90ed608 to your computer and use it in GitHub Desktop.
metabase redux cleanup regexes
String literal action names in action creator:
Find: (export\s+const\s+\w+\s*=\s*create(?:Thunk)?Action)\("([^"]+)"
Replace: export const $2 = "$2";\n$1($2
Un-namespaced action constants:
Find: export\s+const\s+(\w+)\s*=\s*["']([A-Z_]+)["']
Replace: export const $1 = "metabase/NAMESPACE/$2"
String literal action names in reducer:
Find: \[["']([A-Z_]+)["']\]\s*:
Replace: [$1]:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment