title: Can't use babel to convert tsyringe typescript files to javascript
body: <p>It seems that babel/plugin-proposal-decorators is not converting the tsyringe inject() and injectable() to javascript. This is the script that i'm using to convert my typescript files to javascript:</p>
  <pre><code>&quot;build&quot;: &quot;babel src --extensions \&quot;.js,.ts\&quot; --out-dir dist --copy-files --no-copy-ignored&quot;
  </code></pre>
  <p>This is my babel.config.js:</p>
  <pre><code>module.exports = {
    presets: [
      [
        '@babel/preset-env',
        {
          targets: {
            node: 'current',
          },
        },
      ],
      '@babel/preset-typescript',
    ],
    plugins: [
      [
        'module-resolver',
        {
          alias: {
            '@modules': './src/modules',
            '@config': './src/config',
            '@shared': './src/shared',
          },
        },
      ],
      ['@babel/plugin-proposal-decorators', { legacy: true }],
    ],
    ignore: ['**/*.spec.ts'],
  };
  </code></pre>
  <p>And this is the error that returns to me in terminal:</p>
  <pre><code>TypeInfo not known for &quot;CreateUserService&quot;
  </code></pre>
  <p>This is my CreateUserService.ts file. This is a service that I use to create a new user in my application, and I use two tsyringes containers (usersRepository and hashProvider). I am using <strong>TypeORM</strong> as my ORM:</p>
  <pre><code>import 'reflect-metadata';
  import { injectable, inject } from 'tsyringe';
  
  import AppError from '@shared/errors/AppError';
  import User from '@modules/users/infra/typeorm/entities/User';
  
  // Interfaces
  import IUsersRepository from '@modules/users/repositories/IUsersRepository';
  import IHashProvider from '@shared/containers/providers/HashProvider/models/IHashProvider';
  import ICreateUserDTO from '../dtos/ICreateUserDTO';
  
  @injectable()
  export default class CreateUserService {
    constructor(
      @inject('UsersRepository')
      private usersRepository: IUsersRepository,
  
      @inject('HashProvider')
      private hashProvider: IHashProvider,
    ) {}
  
    public async execute(data: ICreateUserDTO): Promise&lt;User&gt; {
      const { name, email, password, userType } = data;
  
      // Use findByEmail method to check if the user exists
      const checkIfUserExists = await this.usersRepository.findByEmail(email);
  
      // If user exists, it'll return a error
      if (checkIfUserExists) {
        throw new AppError('Email address already used.');
      }
  
      // Hash the password with bcrypt
      const hashedPassword = await this.hashProvider.createHash(password);
  
      // Create a new User in database
      const user = await this.usersRepository.create({
        name,
        email,
        password: hashedPassword, // Database will have only the hashed password
        userType,
      });
  
      return user;
    }
  }
  </code></pre>