File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ import { version } from "../../package.json";
12
12
13
13
type GetCodeFn = ( loc : t . SourceLocation ) => string ;
14
14
15
- const babelPluginUntyped : PluginItem = function ( api : ConfigAPI ) {
15
+ const babelPluginUntyped : PluginItem = function (
16
+ api : ConfigAPI ,
17
+ options : { experimentalFunctions ?: boolean }
18
+ ) {
16
19
api . cache . using ( ( ) => version ) ;
17
20
18
21
return < PluginObj > {
@@ -89,10 +92,13 @@ const babelPluginUntyped: PluginItem = function (api: ConfigAPI) {
89
92
schema . type = "function" ;
90
93
schema . args = [ ] ;
91
94
92
- // TODO: Check for possible external regressions and only opt-in for loader if any
93
- // if (!schema.tags.includes("@untyped")) {
94
- // return;
95
- // }
95
+ // Experimental functions meta support
96
+ if (
97
+ ! options . experimentalFunctions &&
98
+ ! schema . tags . includes ( "@untyped" )
99
+ ) {
100
+ return ;
101
+ }
96
102
97
103
const _getLines = cachedFn ( ( ) => this . file . code . split ( "\n" ) ) ;
98
104
const getCode : GetCodeFn = ( loc ) => {
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export async function loadSchema(
23
23
interopDefault : true ,
24
24
transformOptions : {
25
25
babel : {
26
- plugins : [ untypedPlugin ] ,
26
+ plugins : [ [ untypedPlugin , { experimentalFunctions : true } ] ] ,
27
27
} ,
28
28
} ,
29
29
} )
You can’t perform that action at this time.
0 commit comments