BVB Source Codes

prettier Show es6modules.js Source code

Return Download prettier: download es6modules.js Source code - Download prettier Source code - Type:.js
  1. /* @flow */
  2.  
  3. // ===================== //
  4. // == Path Resolution == //
  5. // ===================== //
  6.  
  7. // @providesModule
  8. import * as DefaultA from "A";
  9. var a1: number = DefaultA.numberValue1;
  10. var a2: string = DefaultA.numberValue1; // Error: number ~> string
  11.  
  12. // File path
  13. import * as DefaultB from "./B";
  14. var b1: number = DefaultB.numberValue;
  15. var b2: string = DefaultB.numberValue; // Error: number ~> string
  16.  
  17. // C.js exists, but not as a providesModule
  18. import DefaultC from "C"; // Error: No such module
  19.  
  20. // @providesModule D exists, but not as a filename
  21. import DefaultD from "./D"; // Error: No such module
  22.  
  23. // ================================================ //
  24. // == CommonJS Clobbering Literal Exports -> ES6 == //
  25. // ================================================ //
  26.  
  27. import {doesntExist1} from "CommonJS_Clobbering_Lit"; // Error: Not an exported binding
  28.  
  29. import {numberValue1} from "CommonJS_Clobbering_Lit";
  30. var c1: number = numberValue1;
  31. var c2: string = numberValue1; // Error: number ~> string
  32.  
  33. import {numberValue2 as numVal1} from "CommonJS_Clobbering_Lit";
  34. var d1: number = numVal1;
  35. var d2: string = numVal1; // Error: number ~> string
  36.  
  37. import CJS_Clobb_Lit from "CommonJS_Clobbering_Lit";
  38. var e1: number = CJS_Clobb_Lit.numberValue3;
  39. var e2: string = CJS_Clobb_Lit.numberValue3; // Error: number ~> string
  40. CJS_Clobb_Lit.doesntExist; // Error: doesntExist isn't a property
  41.  
  42. import * as CJS_Clobb_Lit_NS from "CommonJS_Clobbering_Lit";
  43. var f1: number = CJS_Clobb_Lit_NS.numberValue4;
  44. var f2: number = CJS_Clobb_Lit_NS.default.numberValue4;
  45. CJS_Clobb_Lit_NS.default.default; // Error: No 'default' property on the exported obj
  46. var f3: string = CJS_Clobb_Lit_NS.numberValue4; // Error: number ~> string
  47. var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; // Error: number ~> string
  48.  
  49. // ============================================== //
  50. // == CommonJS Clobbering Class Exports -> ES6 == //
  51. // ============================================== //
  52.  
  53. import {doesntExist2} from "CommonJS_Clobbering_Class"; // Error: Not an exported binding
  54.  
  55. // The following import should error because class statics are not turned into
  56. // named exports for now. This avoids complexities with polymorphic static
  57. // members (where the polymophism is defined on the class itself rather than the
  58. // method).
  59. import {staticNumber1, baseProp, childProp} from "CommonJS_Clobbering_Class"; // Error
  60.  
  61. import CJS_Clobb_Class from "CommonJS_Clobbering_Class";
  62. new CJS_Clobb_Class();
  63. new CJS_Clobb_Class().doesntExist; // Error: Class has no `doesntExist` property
  64. var h1: number = CJS_Clobb_Class.staticNumber2();
  65. var h2: string = CJS_Clobb_Class.staticNumber2(); // Error: number ~> string
  66. var h3: number = new CJS_Clobb_Class().instNumber1();
  67. var h4: string = new CJS_Clobb_Class().instNumber1(); // Error: number ~> string
  68.  
  69. import * as CJS_Clobb_Class_NS from "CommonJS_Clobbering_Class";
  70. new CJS_Clobb_Class_NS(); // Error: Namespace object isn't constructable
  71. var i1: number = CJS_Clobb_Class_NS.staticNumber3(); // Error: Class statics not copied to Namespace object
  72. var i2: number = new CJS_Clobb_Class_NS.default().instNumber2();
  73. var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); // Error: number ~> string
  74.  
  75. // =================================== //
  76. // == CommonJS Named Exports -> ES6 == //
  77. // =================================== //
  78.  
  79. import {doesntExist3} from "CommonJS_Named"; // Error: Not an exported binding
  80.  
  81. import {numberValue2} from "CommonJS_Named";
  82. var j1: number = numberValue2;
  83. var j2: string = numberValue2; // Error: number ~> string
  84.  
  85. import {numberValue3 as numVal3} from "CommonJS_Named";
  86. var k1: number = numVal3;
  87. var k2: string = numVal3; // Error: number ~> string
  88.  
  89. import * as CJS_Named from "CommonJS_Named";
  90. var l1: number = CJS_Named.numberValue1;
  91. var l2: string = CJS_Named.numberValue1; // Error: number ~> string
  92. CJS_Named.doesntExist; // Error: doesntExist isn't a property
  93.  
  94. import * as CJS_Named_NS from "CommonJS_Named";
  95. var m1: number = CJS_Named_NS.numberValue4;
  96. var m2: string = CJS_Named_NS.default.numberValue4; // Error: CommonJS_Named has no default export
  97. var m3: string = CJS_Named_NS.numberValue4; // Error: number ~> string
  98.  
  99. //////////////////////////////
  100. // == ES6 Default -> ES6 == //
  101. //////////////////////////////
  102.  
  103. import {doesntExist4} from "ES6_Default_AnonFunction1"; // Error: Not an exported binding
  104.  
  105. import ES6_Def_AnonFunc1 from "ES6_Default_AnonFunction1";
  106. var n1: number = ES6_Def_AnonFunc1();
  107. var n2: string = ES6_Def_AnonFunc1(); // Error: number ~> string
  108.  
  109. import ES6_Def_NamedFunc1 from "ES6_Default_NamedFunction1";
  110. var o1: number = ES6_Def_NamedFunc1();
  111. var o2: string = ES6_Def_NamedFunc1(); // Error: number ~> string
  112.  
  113.  
  114.  
  115.  
  116.  
  117. import ES6_Def_NamedClass1 from "ES6_Default_NamedClass1";
  118. var q1: number = new ES6_Def_NamedClass1().givesANum();
  119. var q2: string = new ES6_Def_NamedClass1().givesANum(); // Error: number ~> string
  120.  
  121. ////////////////////////////
  122. // == ES6 Named -> ES6 == //
  123. ////////////////////////////
  124.  
  125. import doesntExist5 from "ES6_Named1"; // Error: Not an exported binding
  126.  
  127. import {specifierNumber1 as specifierNumber1_1} from "ES6_Named1";
  128. var r1: number = specifierNumber1_1;
  129. var r2: string = specifierNumber1_1; // Error: number ~> string
  130.  
  131. import {specifierNumber2Renamed} from "ES6_Named1";
  132. var s1: number = specifierNumber2Renamed;
  133. var s2: string = specifierNumber2Renamed; // Error: number ~> string
  134.  
  135. import {specifierNumber3 as specifierNumber3Renamed} from "ES6_Named1";
  136. var t1: number = specifierNumber3Renamed;
  137. var t2: string = specifierNumber3Renamed; // Error: number ~> string
  138.  
  139. import {groupedSpecifierNumber1, groupedSpecifierNumber2} from "ES6_Named1";
  140. var u1: number = groupedSpecifierNumber1;
  141. var u2: number = groupedSpecifierNumber2;
  142. var u3: string = groupedSpecifierNumber1; // Error: number ~> string
  143. var u4: string = groupedSpecifierNumber2; // Error: number ~> string
  144.  
  145. import {givesANumber} from "ES6_Named1";
  146. var v1: number = givesANumber();
  147. var v2: string = givesANumber(); // Error: number ~> string
  148.  
  149. import {NumberGenerator} from "ES6_Named1";
  150. var w1: number = new NumberGenerator().givesANumber();
  151. var w2: string = new NumberGenerator().givesANumber(); // Error: number ~> string
  152.  
  153. import {varDeclNumber1, varDeclNumber2} from "ES6_Named1";
  154. var x1: number = varDeclNumber1;
  155. var x2: number = varDeclNumber2;
  156. var x3: string = varDeclNumber1; // Error: number ~> string
  157. var x4: string = varDeclNumber2; // Error: number ~> string
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167. import {numberValue1 as numberValue4} from "ES6_ExportFrom_Intermediary1";
  168. var aa1: number = numberValue4;
  169. var aa2: string = numberValue4; // Error: number ~> string
  170.  
  171. import {numberValue2_renamed} from "ES6_ExportFrom_Intermediary1";
  172. var ab1: number = numberValue2_renamed;
  173. var ab2: string = numberValue2_renamed; // Error: number ~> string
  174.  
  175. import {numberValue1 as numberValue5} from "ES6_ExportAllFrom_Intermediary1";
  176. var ac1: number = numberValue5;
  177. var ac2: string = numberValue5; // Error: number ~> string
  178.  
  179. ///////////////////////////////////
  180. // == ES6 Default -> CommonJS == //
  181. ///////////////////////////////////
  182.  
  183. require('ES6_Default_AnonFunction2').doesntExist; // Error: 'doesntExist' isn't an export
  184.  
  185. var ES6_Def_AnonFunc2 = require("ES6_Default_AnonFunction2").default;
  186. var ad1: number = ES6_Def_AnonFunc2();
  187. var ad2: string = ES6_Def_AnonFunc2(); // Error: number ~> string
  188.  
  189. var ES6_Def_NamedFunc2 = require("ES6_Default_NamedFunction2").default;
  190. var ae1: number = ES6_Def_NamedFunc2();
  191. var ae2: string = ES6_Def_NamedFunc2(); // Error: number ~> string
  192.  
  193.  
  194.  
  195.  
  196.  
  197. var ES6_Def_NamedClass2 = require("ES6_Default_NamedClass2").default;
  198. var ag1: number = new ES6_Def_NamedClass2().givesANum();
  199. var ag2: string = new ES6_Def_NamedClass2().givesANum(); // Error: number ~> string
  200.  
  201. /////////////////////////////////
  202. // == ES6 Named -> CommonJS == //
  203. /////////////////////////////////
  204.  
  205. var specifierNumber4 = require("ES6_Named2").specifierNumber4;
  206. var ah1: number = specifierNumber4;
  207. var ah2: string = specifierNumber4; // Error: number ~> string
  208.  
  209. var specifierNumber5Renamed = require("ES6_Named2").specifierNumber5Renamed;
  210. var ai1: number = specifierNumber5Renamed;
  211. var ai2: string = specifierNumber5Renamed; // Error: number ~> string
  212.  
  213. var groupedSpecifierNumber3 = require("ES6_Named2").groupedSpecifierNumber3;
  214. var groupedSpecifierNumber4 = require("ES6_Named2").groupedSpecifierNumber4;
  215. var aj1: number = groupedSpecifierNumber3;
  216. var aj2: number = groupedSpecifierNumber4;
  217. var aj3: string = groupedSpecifierNumber3; // Error: number ~> string
  218. var aj4: string = groupedSpecifierNumber4; // Error: number ~> string
  219.  
  220. var givesANumber2 = require("ES6_Named2").givesANumber2;
  221. var ak1: number = givesANumber2();
  222. var ak2: string = givesANumber2(); // Error: number ~> string
  223.  
  224. var NumberGenerator2 = require("ES6_Named2").NumberGenerator2;
  225. var al1: number = new NumberGenerator2().givesANumber();
  226. var al2: string = new NumberGenerator2().givesANumber(); // Error: number ~> string
  227.  
  228. var varDeclNumber3 = require("ES6_Named2").varDeclNumber3;
  229. var varDeclNumber4 = require("ES6_Named2").varDeclNumber4;
  230. var am1: number = varDeclNumber3;
  231. var am2: number = varDeclNumber4;
  232. var am3: string = varDeclNumber3; // Error: number ~> string
  233. var am4: string = varDeclNumber4; // Error: number ~> string
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243. var numberValue6 = require("ES6_ExportFrom_Intermediary2").numberValue1;
  244. var ap1: number = numberValue6;
  245. var ap2: string = numberValue6; // Error: number ~> string
  246.  
  247. var numberValue2_renamed2 = require("ES6_ExportFrom_Intermediary2").numberValue2_renamed2;
  248. var aq1: number = numberValue2_renamed2;
  249. var aq2: string = numberValue2_renamed2; // Error: number ~> string
  250.  
  251. var numberValue7 = require("ES6_ExportAllFrom_Intermediary2").numberValue2;
  252. var ar1: number = numberValue7;
  253. var ar2: string = numberValue7; // Error: number ~> string
  254.  
  255. ////////////////////////////////////////////////////////
  256. // == ES6 Default+Named -> ES6 import Default+Named== //
  257. ////////////////////////////////////////////////////////
  258.  
  259. import defaultNum, {str as namedStr} from "./ES6_DefaultAndNamed";
  260.  
  261. var as1: number = defaultNum;
  262. var as2: string = defaultNum; // Error: number ~> string
  263.  
  264. var as3: string = namedStr;
  265. var as4: number = namedStr; // Error: string ~> number
  266.  
  267. ////////////////////////////////////////
  268. // == Side-effect only ES6 imports == //
  269. ////////////////////////////////////////
  270.  
  271. import "./SideEffects";
  272.  
  273. //////////////////////////////////////////////
  274. // == Suggest export name on likely typo == //
  275. //////////////////////////////////////////////
  276. import specifierNumber1 from "ES6_Named1"; // Error: Did you mean `import {specifierNumber1} from ...`?
  277. import {specifierNumber} from "ES6_Named1"; // Error: Did you mean `specifierNumber1`?
  278.  
  279. ///////////////////////////////////////////////////
  280. // == Multi `export *` should combine exports == //
  281. ///////////////////////////////////////////////////
  282. import {
  283.   numberValue1 as numberValue8,
  284.   numberValue2 as numberValue9
  285. } from "./ES6_ExportAllFromMulti";
  286.  
  287. var at1: number = numberValue8;
  288. var at2: string = numberValue8; // Error: number ~> string
  289.  
  290. var at3: number = numberValue9;
  291. var at4: string = numberValue9; // Error: number ~> string
  292.  
downloades6modules.js Source code - Download prettier Source code
Related Source Codes/Software:
storybook - 2017-06-07
ionicons - The premium icon font for Ionic ... 2017-06-07
AsyncDisplayKit - Smooth asynchronous user interfaces for iOS apps. ... 2017-06-07
lottie-android - Render After Effects animations natively on Androi... 2017-06-07
parse-server - Parse-compatible API server module for Node/Expres... 2017-06-07
inferno - An extremely fast, React-like JavaScript library f... 2017-06-08
guetzli - Perceptual JPEG encoder 2017-06-08
cs-video-courses - List of Computer Science courses with video lectur... 2017-06-08
interviews - Everything you need to know to get the job. 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top