mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
Remove corejs2 and legacy files from compat-data (#17633)
* Remove corejs2 and legacy files from compat-data * Suppress wrong linting errors * Update eslint comment
This commit is contained in:
@@ -2,7 +2,6 @@ import babelParser from "@babel/eslint-parser/experimental-worker";
|
||||
import globals from "globals";
|
||||
import js from "@eslint/js";
|
||||
import { defineConfig } from "eslint/config";
|
||||
// @ts-expect-error no types
|
||||
import pluginImport from "eslint-plugin-import";
|
||||
import pluginJest from "eslint-plugin-jest";
|
||||
import pluginN from "eslint-plugin-n";
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-formatter-codeframe": "^7.32.1",
|
||||
"eslint-import-resolver-node": "^0.3.9",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jest": "^29.0.1",
|
||||
"eslint-plugin-n": "^17.10.3",
|
||||
"eslint-plugin-regexp": "^2.6.0",
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
// Todo (Babel 8): remove this file as Babel 8 drop support of core-js 2
|
||||
module.exports = require("./data/corejs2-built-ins.json");
|
||||
@@ -1,2 +0,0 @@
|
||||
// Todo (Babel 8): remove this file now that it is included in babel-plugin-polyfill-corejs3
|
||||
module.exports = require("./data/corejs3-shipped-proposals.json");
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +0,0 @@
|
||||
[
|
||||
"esnext.promise.all-settled",
|
||||
"esnext.string.match-all",
|
||||
"esnext.global-this"
|
||||
]
|
||||
@@ -1,2 +0,0 @@
|
||||
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
|
||||
module.exports = require("./data/native-modules.json");
|
||||
@@ -1,2 +0,0 @@
|
||||
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
|
||||
module.exports = require("./data/overlapping-plugins.json");
|
||||
@@ -1,2 +0,0 @@
|
||||
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
|
||||
module.exports = require("./data/plugin-bugfixes.json");
|
||||
@@ -1,2 +0,0 @@
|
||||
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
|
||||
module.exports = require("./data/plugins.json");
|
||||
@@ -1,16 +0,0 @@
|
||||
import { generateData, environments, writeFile } from "./utils-build-data.mjs";
|
||||
|
||||
import corejs2BuiltInFeatures from "./data/corejs2-built-in-features.mjs";
|
||||
|
||||
if (process.cwd().endsWith("scripts")) {
|
||||
throw new Error("Please run this script from the root of the package");
|
||||
}
|
||||
|
||||
export function buildCorejs2BuiltinFeatures() {
|
||||
const { data: newData } = generateData(environments, corejs2BuiltInFeatures);
|
||||
const dataURL = new URL(`../data/corejs2-built-ins.json`, import.meta.url);
|
||||
|
||||
if (!writeFile(newData, dataURL, "corejs2-built-in")) {
|
||||
throw new Error(`Cannot update ${dataURL}`);
|
||||
}
|
||||
}
|
||||
@@ -8,11 +8,6 @@ const shippedProposals = features.filter(feature => {
|
||||
return feature.startsWith("esnext.") && Object.keys(data[feature]).length > 0;
|
||||
});
|
||||
|
||||
fs.writeFileSync(
|
||||
new URL("../data/corejs3-shipped-proposals.json", import.meta.url),
|
||||
JSON.stringify(shippedProposals, undefined, 2) + "\n"
|
||||
);
|
||||
|
||||
const finishedProposals = shippedProposals.filter(feature => {
|
||||
return features.includes(feature.replace("esnext.", "es."));
|
||||
});
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
maybeDefineLegacyPluginAliases,
|
||||
} from "./utils-build-data.mjs";
|
||||
import pluginFeatures from "./data/plugin-features.mjs";
|
||||
import { buildCorejs2BuiltinFeatures } from "./build-corejs2-built-in-features.mjs";
|
||||
|
||||
const compatData = browserCompatData.javascript;
|
||||
if (process.cwd().endsWith("scripts")) {
|
||||
@@ -35,4 +34,3 @@ function buildPluginFeatures() {
|
||||
}
|
||||
|
||||
buildPluginFeatures();
|
||||
buildCorejs2BuiltinFeatures();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import semver from "semver";
|
||||
|
||||
// https://github.com/import-js/eslint-plugin-import/issues/1810
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import pluginsCompatData from "@babel/compat-data/plugins" with { type: "json" };
|
||||
|
||||
import type { Targets } from "./types.ts";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import browserslist from "browserslist";
|
||||
import { findSuggestion } from "@babel/helper-validator-option";
|
||||
// https://github.com/import-js/eslint-plugin-import/issues/1810
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import browserModulesData from "@babel/compat-data/native-modules" with { type: "json" };
|
||||
import LruCache from "lru-cache";
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
// https://github.com/import-js/eslint-plugin-import/issues/1810
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import originalPlugins from "@babel/compat-data/plugins" with { type: "json" };
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import originalPluginsBugfixes from "@babel/compat-data/plugin-bugfixes" with { type: "json" };
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import originalOverlappingPlugins from "@babel/compat-data/overlapping-plugins" with { type: "json" };
|
||||
import availablePlugins from "./available-plugins.ts";
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ const availablePlugins = _availablePlugins.default || _availablePlugins;
|
||||
import { createRequire } from "node:module";
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
// eslint-disable-next-line import/extensions
|
||||
// eslint-disable-next-line import/no-unresolved, import/extensions
|
||||
import compatData from "@babel/compat-data/plugins" with { type: "json" };
|
||||
// eslint-disable-next-line import/extensions
|
||||
// eslint-disable-next-line import/no-unresolved, import/extensions
|
||||
import bugfixesData from "@babel/compat-data/plugin-bugfixes" with { type: "json" };
|
||||
|
||||
describe("babel-preset-env", () => {
|
||||
|
||||
Reference in New Issue
Block a user