Use native ESM for dev scripts (#12296)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
"use strict";
|
||||
const t = require("@babel/types");
|
||||
import t from "@babel/types";
|
||||
|
||||
module.exports = function generateAsserts() {
|
||||
export default function generateAsserts() {
|
||||
let output = `/*
|
||||
* This file is auto-generated! Do not modify it directly.
|
||||
* To re-generate run 'make build'
|
||||
@@ -12,7 +11,7 @@ import NodePath from "../index";
|
||||
|
||||
export interface NodePathAssetions {`;
|
||||
|
||||
for (const type of t.TYPES) {
|
||||
for (const type of [...t.TYPES].sort()) {
|
||||
output += `
|
||||
assert${type}(
|
||||
opts?: object,
|
||||
@@ -23,4 +22,4 @@ export interface NodePathAssetions {`;
|
||||
}`;
|
||||
|
||||
return output;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
"use strict";
|
||||
import t from "@babel/types";
|
||||
import virtualTypes from "../../lib/path/lib/virtual-types.js";
|
||||
import definitions from "@babel/types/lib/definitions/index.js";
|
||||
|
||||
const t = require("@babel/types");
|
||||
const virtualTypes = require("../../lib/path/lib/virtual-types");
|
||||
|
||||
const definitions = require("@babel/types/lib/definitions");
|
||||
|
||||
module.exports = function generateValidators() {
|
||||
export default function generateValidators() {
|
||||
let output = `/*
|
||||
* This file is auto-generated! Do not modify it directly.
|
||||
* To re-generate run 'make build'
|
||||
@@ -16,7 +13,7 @@ import NodePath from "../index";
|
||||
export interface NodePathValidators {
|
||||
`;
|
||||
|
||||
for (const type of t.TYPES) {
|
||||
for (const type of [...t.TYPES].sort()) {
|
||||
output += `is${type}(opts?: object): this is NodePath<t.${type}>;`;
|
||||
}
|
||||
|
||||
@@ -34,4 +31,4 @@ export interface NodePathValidators {
|
||||
`;
|
||||
|
||||
return output;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
"use strict";
|
||||
import virtualTypes from "../../lib/path/lib/virtual-types.js";
|
||||
|
||||
const virtualTypes = require("../../lib/path/lib/virtual-types");
|
||||
|
||||
module.exports = function generateValidators() {
|
||||
export default function generateValidators() {
|
||||
let output = `/*
|
||||
* This file is auto-generated! Do not modify it directly.
|
||||
* To re-generate run 'make build'
|
||||
@@ -23,4 +21,4 @@ export interface VirtualTypeAliases {
|
||||
`;
|
||||
|
||||
return output;
|
||||
};
|
||||
}
|
||||
|
||||
1
packages/babel-traverse/scripts/package.json
Normal file
1
packages/babel-traverse/scripts/package.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "type": "module" }
|
||||
Reference in New Issue
Block a user