Skip to content

Commit 0498bfa

Browse files
committed
refactor(getApplicableDirectives): make whole babel object available
in order to have it available for directive options
1 parent 11b3065 commit 0498bfa

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/babelPluginTransformJsxDirectives.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function babelPluginTransformJsxDirectives(babel) {
2020
visitor: {
2121
JSXOpeningElement(path, state) {
2222
const directives = getApplicableDirectives(
23-
t,
23+
babel,
2424
path,
2525
normalizeDirectives(state.opts && state.opts.directives)
2626
);

src/getApplicableDirectives.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
export default function getApplicableDirectives(t, path, directives) {
1+
export default function getApplicableDirectives(babel, path, directives) {
2+
const t = babel.types;
3+
24
if (!directives.length) {
35
return [];
46
}

0 commit comments

Comments
 (0)