Skip to content

Commit

Permalink
disable skipLibCheck, fix errors in definitions (#14792)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxbodya committed Jul 24, 2022
1 parent acee429 commit 3e3e7a8
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 65 deletions.
2 changes: 1 addition & 1 deletion Gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ ${fs.readFileSync(path.join(path.dirname(input), "license"), "utf8")}*/

fs.writeFileSync(
output.replace(".js", ".d.ts"),
`export function resolve(specifier: stirng, parent: string): Promise<string>;`
`export function resolve(specifier: string, parent: string): Promise<string>;`
);
});

Expand Down
106 changes: 63 additions & 43 deletions lib/archived-libs.d.ts
Original file line number Diff line number Diff line change
@@ -1,87 +1,107 @@
/* This file is automatically generated by scripts/generators/archived-libs-typings.js */
import { declare } from "@babel/helper-plugin-utils";

declare module "@babel/plugin-syntax-async-functions" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-async-generators" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-bigint" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-class-properties" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-class-static-block" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-dynamic-import" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-exponentiation-operator" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-export-extensions" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-export-namespace-from" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-import-meta" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-json-strings" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-logical-assignment-operators" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-module-string-names" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-nullish-coalescing-operator" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-numeric-separator" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-object-rest-spread" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-optional-catch-binding" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-optional-chaining" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-private-property-in-object" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-top-level-await" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
declare module "@babel/plugin-syntax-trailing-function-commas" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
5 changes: 3 additions & 2 deletions lib/babel-plugin-dynamic-import-node.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { PluginAPI } from "@babel/core";
import type * as t from "@babel/types";
// https://github.com/airbnb/babel-plugin-dynamic-import-node/blob/master/src/utils.js
declare module "babel-plugin-dynamic-import-node/utils" {
import type { PluginAPI, PluginPass } from "@babel/core";
import type { NodePath } from "@babel/traverse";
import type * as t from "@babel/types";
function getImportSource(
t: typeof import("@babel/types"),
callNode: t.CallExpression
Expand Down
2 changes: 1 addition & 1 deletion lib/regexpu-core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ declare module "regexpu-core" {
flags: string,
options: RegexpuOptions
): string;
export = rewritePattern;
export default rewritePattern;
export { RegexpuOptions };
}
43 changes: 30 additions & 13 deletions lib/third-party-libs.d.ts
Original file line number Diff line number Diff line change
@@ -1,50 +1,67 @@
import type { PluginPass } from "@babel/core";
import { declare } from "@babel/helper-plugin-utils";
import type * as t from "@babel/types";
declare module "js-tokens" {
// TODO(Babel 8): Remove this
export { default } from "js-tokens-BABEL_8_BREAKING-true";
export * from "js-tokens-BABEL_8_BREAKING-true";
}

declare module "@babel/preset-modules/lib/plugins/transform-async-arrows-in-class" {
import { declare } from "@babel/helper-plugin-utils";
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
let exports: {default: typeof plugin};
export = exports;
}
declare module "@babel/preset-modules/lib/plugins/transform-edge-default-parameters" {
import { declare } from "@babel/helper-plugin-utils";
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
let exports: {default: typeof plugin};
export = exports;
}
declare module "@babel/preset-modules/lib/plugins/transform-edge-function-name" {
import { declare } from "@babel/helper-plugin-utils";
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
let exports: {default: typeof plugin};
export = exports;
}
declare module "@babel/preset-modules/lib/plugins/transform-tagged-template-caching" {
import { declare } from "@babel/helper-plugin-utils";
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
let exports: {default: typeof plugin};
export = exports;
}
declare module "@babel/preset-modules/lib/plugins/transform-safari-block-shadowing" {
import { declare } from "@babel/helper-plugin-utils";
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
let exports: {default: typeof plugin};
export = exports;
}
declare module "@babel/preset-modules/lib/plugins/transform-safari-for-shadowing" {
import { declare } from "@babel/helper-plugin-utils";
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
let exports: {default: typeof plugin};
export = exports;
}
declare module "babel-plugin-polyfill-corejs2" {
import { declare } from "@babel/helper-plugin-utils";
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
let exports: {default: typeof plugin};
export = exports;
}
declare module "babel-plugin-polyfill-corejs3" {
import { declare } from "@babel/helper-plugin-utils";
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
let exports: {default: typeof plugin};
export = exports;
}
declare module "babel-plugin-polyfill-regenerator" {
import { declare } from "@babel/helper-plugin-utils";
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
let exports: {default: typeof plugin};
export = exports;
}

declare module "regenerator-transform" {
import { declare } from "@babel/helper-plugin-utils";
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
let exports: {default: typeof plugin};
export = exports;
}
2 changes: 1 addition & 1 deletion packages/babel-core/src/vendor/import-meta-resolve.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export function resolve(specifier: stirng, parent: string): Promise<string>;
export function resolve(specifier: string, parent: string): Promise<string>;
6 changes: 3 additions & 3 deletions scripts/generators/archived-libs-typings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ const archivedSyntaxPkgs = JSON.parse(
const root = new URL("../..", import.meta.url);

let output = `/* This file is automatically generated by scripts/generators/archived-libs-typings.js */
import { declare } from "@babel/helper-plugin-utils";
`;

for (const pkgName of archivedSyntaxPkgs) {
output += `declare module "${pkgName}" {
let plugin: ReturnType<typeof declare>;
export = { default: plugin };
import { declare } from "@babel/helper-plugin-utils";
let exports: {default: ReturnType<typeof declare>};
export = exports;
}
`;
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"moduleResolution": "node",
"esModuleInterop": true,
"isolatedModules": true,
"skipLibCheck": true,
"skipLibCheck": false,
"resolveJsonModule": true,
"noImplicitThis": true,
"noImplicitAny": true,
Expand Down

0 comments on commit 3e3e7a8

Please sign in to comment.