blob: 501fa656a3c8c2470ec9fa3cf7a9154e9079b8a8 [file] [log] [blame]
Kai Ninomiya8f57bd62019-10-25 14:50:37 -07001module.exports = function (api) {
Kai Ninomiyae43fd9e2019-08-15 13:43:56 -07002 api.cache(true);
3 return {
4 presets: ['@babel/preset-typescript'],
5 plugins: [
6 '@babel/plugin-proposal-class-properties',
Kai Ninomiyadc98c8d2020-01-06 19:36:00 -08007 'const-enum',
Kai Ninomiyae43fd9e2019-08-15 13:43:56 -07008 [
9 'add-header-comment',
10 {
11 header: ['AUTO-GENERATED - DO NOT EDIT. Source: https://github.com/gpuweb/cts'],
12 },
13 ],
14 ],
15 compact: false,
Kai Ninomiya8ffa3542020-06-09 18:26:19 -070016 // Keeps comments from getting hoisted to the end of the previous line of code.
17 // (Also keeps lines close to their original line numbers - but for WPT we
18 // reformat with prettier anyway.)
19 retainLines: true,
Kai Ninomiyaad7831f2020-06-09 18:22:08 -070020 shouldPrintComment: val => !/eslint|prettier-ignore/.test(val),
Kai Ninomiyae43fd9e2019-08-15 13:43:56 -070021 };
22};