blob: ad977bc510ee91925d3d8040ba806e0c48126bab [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: [
Kai Ninomiyadc98c8d2020-01-06 19:36:00 -08006 'const-enum',
Kai Ninomiyae43fd9e2019-08-15 13:43:56 -07007 [
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 Ninomiya8ffa3542020-06-09 18:26:19 -070015 // 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 Ninomiyaad7831f2020-06-09 18:22:08 -070019 shouldPrintComment: val => !/eslint|prettier-ignore/.test(val),
Kai Ninomiyae43fd9e2019-08-15 13:43:56 -070020 };
21};