linaria icon indicating copy to clipboard operation
linaria copied to clipboard

CLI doesn't work on typescript files without a babelrc / Setting babelConfig in transform() has no effect

Open mx-rd opened this issue 3 years ago • 0 comments

Environment

  • Linaria version: "@linaria/babel-preset": "^4.4.3"
  • Node.js version: v17.4.0
  • OS: MacOS 13.1

Description

  1. Running the CLI on a typescript file will fail when there is no babel config present in the folder, setting @babel/preset-typescript

  2. Calling transform(), exported from @linaria/babel-preset directly with a babelConfig parameter 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

  1. Create an index.ts with some type defintion / typescript syntax.
  2. Run any @linaria/cli command or the transform function

mx-rd avatar Feb 22 '23 23:02 mx-rd