Skip to content

Instantly share code, notes, and snippets.

@kurt-r2c
Created October 19, 2022 17:17
Show Gist options
  • Save kurt-r2c/a2ba822fc45d66ad139a3126f32cc894 to your computer and use it in GitHub Desktop.
Save kurt-r2c/a2ba822fc45d66ad139a3126f32cc894 to your computer and use it in GitHub Desktop.
patterns:
- metavariable-regex:
metavariable: $FUNC
regex: (NOTSET)
- pattern-either:
- patterns:
- pattern-either:
- pattern: $IMPORT.$FUNC(...)
- pattern: $IMPORT.$FUNC.call(...)
- pattern: $F(...,$IMPORT.$FUNC,...)
- pattern-either:
- pattern-inside: |
$IMPORT = require("{package}");
...
- pattern-inside: |
import("{package}").then(...)
- patterns:
- pattern-inside: |
$LD = require("{package}");
...
- pattern-inside: |
global.$IMPORT = $LD
...
- pattern-inside: |
import $IMPORT from "{package}";
...
- pattern-inside: |
$IMPORT = await import("{package}")
...
- pattern-inside: |
$IMPORT = (await import("{package}")).$Y
...
- pattern-inside: |
import * as $IMPORT from "{package}";
...
- patterns:
- pattern-either:
- pattern: $FUNC(...)
- pattern: $FUNC.call(...)
- pattern: pipe(...,$FUNC,...)
- pattern-either:
- pattern-inside: |
import { $FUNC } from "{package}";
...
- pattern-inside: |
import $FUNC from "{package}/$FUNC";
...
- pattern-inside: |
import $FUNC from "{package}.$FUNC";
...
- pattern-inside: >
require({'packages':[...,{'name':'{package}',...}]},[...,'{package}/$FUNC'],function($FUNC){...});
...
- patterns:
- pattern: $X(...)
- pattern-inside: |
import { $FUNC as $X } from "{package}";
...
- patterns:
- pattern: |
super.$FUNC.call(...)
- pattern-inside: |
class $CLASS extends $IMPORT {
...
}
- pattern-inside: |
import { $X as $IMPORT } from "{package}";
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment