mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* add types for babel-plugin-macros * rename babel-plugin-macros-test.ts to babel-plugin-macros-tests.ts * add paths in tsconfig.json * remove patch version from version string * remove unnecessary generics * fix import module name and minimum TypeScript version * update minimum TypeScript version to 2.9
15 lines
400 B
TypeScript
15 lines
400 B
TypeScript
import { createMacro, MacroError } from 'babel-plugin-macros';
|
|
|
|
const macro = createMacro(
|
|
({ references, state, babel }) => {
|
|
references.forEach(() => {});
|
|
references.default.forEach(() => {});
|
|
state.abc = 123;
|
|
babel.parse("console.log('Hello world!')");
|
|
throw new MacroError('testing');
|
|
},
|
|
{ configName: 'test' },
|
|
);
|
|
|
|
macro() === 'Hello world!';
|