linaria
linaria copied to clipboard
CLI doesn't work on typescript files without a babelrc / Setting babelConfig in transform() has no effect
Environment
- Linaria version:
"@linaria/babel-preset": "^4.4.3" - Node.js version:
v17.4.0 - OS: MacOS 13.1
Description
-
Running the CLI on a typescript file will fail when there is no babel config present in the folder, setting
@babel/preset-typescript -
Calling
transform(), exported from@linaria/babel-presetdirectly with ababelConfigparameter required seems to have no effect. A present babel config is the only apparent solution.
In both cases, some error relating to whatever typescript syntax is used in the file is thrown.
Reproducible Demo
- Create an index.ts with some type defintion / typescript syntax.
- Run any
@linaria/clicommand or thetransformfunction