Kai Ninomiya | 8f57bd6 | 2019-10-25 14:50:37 -0700 | [diff] [blame] | 1 | module.exports = function (api) { |
Kai Ninomiya | e43fd9e | 2019-08-15 13:43:56 -0700 | [diff] [blame] | 2 | api.cache(true); |
| 3 | return { |
| 4 | presets: ['@babel/preset-typescript'], |
| 5 | plugins: [ |
Kai Ninomiya | dc98c8d | 2020-01-06 19:36:00 -0800 | [diff] [blame] | 6 | 'const-enum', |
Kai Ninomiya | e43fd9e | 2019-08-15 13:43:56 -0700 | [diff] [blame] | 7 | [ |
| 8 | 'add-header-comment', |
| 9 | { |
| 10 | header: ['AUTO-GENERATED - DO NOT EDIT. Source: https://github.com/gpuweb/cts'], |
| 11 | }, |
| 12 | ], |
| 13 | ], |
| 14 | compact: false, |
Kai Ninomiya | 8ffa354 | 2020-06-09 18:26:19 -0700 | [diff] [blame] | 15 | // Keeps comments from getting hoisted to the end of the previous line of code. |
| 16 | // (Also keeps lines close to their original line numbers - but for WPT we |
| 17 | // reformat with prettier anyway.) |
| 18 | retainLines: true, |
Kai Ninomiya | ad7831f | 2020-06-09 18:22:08 -0700 | [diff] [blame] | 19 | shouldPrintComment: val => !/eslint|prettier-ignore/.test(val), |
Kai Ninomiya | e43fd9e | 2019-08-15 13:43:56 -0700 | [diff] [blame] | 20 | }; |
| 21 | }; |