@@ -16,7 +16,7 @@ const args = ({ filepath }) => {
16
16
const cmd = `'${ babel } ' --filename '${ filepath } ' --config-file ${ babelConfig } < '${ filepath } '| node`
17
17
return GrammarUtils . formatArgs ( cmd )
18
18
}
19
- export const Dart = {
19
+ const Dart = {
20
20
"Selection Based" : {
21
21
command : "dart" ,
22
22
args : ( context ) => {
@@ -30,7 +30,7 @@ export const Dart = {
30
30
args : ( { filepath } ) => [ filepath ] ,
31
31
} ,
32
32
}
33
- export const JavaScript = {
33
+ const JavaScript = {
34
34
"Selection Based" : {
35
35
command : GrammarUtils . command ,
36
36
args : ( context ) => {
@@ -41,11 +41,10 @@ export const JavaScript = {
41
41
} ,
42
42
"File Based" : { command : GrammarUtils . command , args } ,
43
43
}
44
- // TODO respect ES6 exporting
45
- exports [ "Babel ES6 JavaScript" ] = JavaScript
46
- exports [ "JavaScript with JSX" ] = JavaScript
44
+ const Babel = JavaScript
45
+ const JSX = JavaScript
47
46
48
- exports [ "JavaScript for Automation ( JXA)" ] = {
47
+ const JXA = {
49
48
"Selection Based" : {
50
49
command : "osascript" ,
51
50
args : ( context ) => [ "-l" , "JavaScript" , "-e" , context . getCode ( ) ] ,
@@ -55,7 +54,7 @@ exports["JavaScript for Automation (JXA)"] = {
55
54
args : ( { filepath } ) => [ "-l" , "JavaScript" , filepath ] ,
56
55
} ,
57
56
}
58
- export const TypeScript = {
57
+ const TypeScript = {
59
58
"Selection Based" : {
60
59
command : "ts-node" ,
61
60
args : ( context ) => [ "-e" , context . getCode ( ) ] ,
@@ -65,3 +64,13 @@ export const TypeScript = {
65
64
args : ( { filepath } ) => [ filepath ] ,
66
65
} ,
67
66
}
67
+
68
+ const JavaScriptGrammars = {
69
+ JavaScript,
70
+ "Babel ES6 JavaScript" : Babel ,
71
+ "JavaScript with JSX" : JSX ,
72
+ Dart,
73
+ "JavaScript for Automation (JXA)" : JXA ,
74
+ TypeScript,
75
+ }
76
+ export default JavaScriptGrammars
0 commit comments