valid.jsx 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import('hello');
  2. // don't validate template by default
  3. var aa = `hello world`;
  4. function bar(a = 'jianhua') { }
  5. var emojis = "🌼🌺🌸";
  6. name === 'Android' || name === 'iOS';
  7. switch (a) {
  8. case 'a':
  9. break;
  10. default:
  11. break;
  12. }
  13. import name from 'hello';
  14. a.indexOf('ios');
  15. a.includes('ios');
  16. a.startsWith('ios');
  17. a.endsWith('@gmail.com');
  18. export * from 'hello_export_all';
  19. export { a } from 'hello_export';
  20. document.addEventListener('click', event => {
  21. event.preventDefault();
  22. });
  23. document.removeEventListener('click', event => {
  24. event.preventDefault();
  25. });
  26. window.postMessage('message', '*');
  27. document.getElementById('some-id');
  28. require('hello');
  29. const a = require(['hello']);
  30. const b = require(['hel' + 'lo']);
  31. const c = 1;
  32. const d = '?';
  33. const e = '0123456789!@#$%^&*()_+|~-=`[]{};\':",./<>?';
  34. i18n('hello');
  35. dispatch('hello');
  36. store.dispatch('hello');
  37. store.commit('hello');
  38. i18n.t('hello');
  39. const f = 'FOO';
  40. const g = `FOO`;
  41. var A_B = `world`;
  42. var A_B = 'world';
  43. var A_B = ['world'];
  44. var z = { ['A_B']: 'hello world' };
  45. var a1 = { [A_B]: 'hello world' };
  46. var a2 = { A_B: 'hello world' };
  47. var a3 = { foo: 123 };
  48. var a4 = { foo: 'FOO' };
  49. class Form extends Component {
  50. displayName = 'FormContainer';
  51. }
  52. <>
  53. <div className="primary"></div>
  54. <div className={a ? 'active' : 'inactive'}></div>
  55. <div>{i18next.t('foo')}</div>
  56. <svg viewBox="0 0 20 40"></svg>
  57. <line x1="0" y1="0" x2="10" y2="20" />
  58. <path d="M10 10" />
  59. <circle width="16px" height="16px" cx="10" cy="10" r="2" fill="red" />
  60. <a href="https://google.com" target="_blank" rel="noreferrer noopener"></a>
  61. <div id="some-id" tabIndex="0" aria-labelledby="label-id"></div>
  62. <div role="button"></div>
  63. <img src="./image.png" />
  64. <A style="bar" />
  65. <button type="button" for="form-id" />
  66. <Trans>foo</Trans>
  67. <Trans>
  68. <span>bar</span>
  69. </Trans>
  70. <span>&times;&amp;</span>
  71. <div>{import("abc")}</div>
  72. </>;