Skip to content

is there an example of how to transform AST of a file and emit it? #7580

@zpdDG4gta8XKpMCd

Description

@zpdDG4gta8XKpMCd

I would like to make a tool to replace imports of old style to imports of new style:

// before
import dsa = require('data/search/account');
// after
import * as dsa from 'data/search/account';

is it possible to do via public compiler api?
if so, can anyone outline the steps?

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIRelates to the public API for TypeScriptQuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions