Add JS-CATCH-FALLBACK-01 rule and update npm packages

Add PHP-ALIAS-01 rule: prohibit field aliasing in serialization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-12-23 07:36:18 +00:00
parent 3cc590186a
commit 3ce82a924a
1256 changed files with 6491 additions and 3989 deletions

View File

@@ -245,45 +245,46 @@ class NodeStuffPlugin {
parser.hooks.expression
.for(expressionName)
.tap(PLUGIN_NAME, (expr) => {
// We use `CachedConstDependency` because of `eval` devtool, there is no `import.meta` inside `eval()`
const { importMetaName, environment, module } =
compilation.outputOptions;
if (
module &&
importMetaName === "import.meta" &&
(expressionName === "import.meta.filename" ||
expressionName === "import.meta.dirname") &&
environment.importMetaDirnameAndFilename
) {
return true;
}
// Generate `import.meta.dirname` and `import.meta.filename` when:
// - they are supported by the environment
// - it is a universal target, because we can't use `import mod from "node:url"; ` at the top file
const dep =
if (
environment.importMetaDirnameAndFilename ||
(compiler.platform.web === null &&
compiler.platform.node === null &&
module)
? new ConstDependency(
`${importMetaName}.${property}`,
/** @type {Range} */
(expr.range)
)
: new ExternalModuleDependency(
"url",
[
{
name: "fileURLToPath",
value: URL_MODULE_CONSTANT_FUNCTION_NAME
}
],
undefined,
`${URL_MODULE_CONSTANT_FUNCTION_NAME}(${value()})`,
/** @type {Range} */ (expr.range),
`__webpack_${property}__`
);
) {
const dep = new CachedConstDependency(
`${importMetaName}.${property}`,
/** @type {Range} */
(expr.range),
`__webpack_${property}__`,
CachedConstDependency.PLACE_CHUNK
);
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
parser.state.module.addPresentationalDependency(dep);
return;
}
const dep = new ExternalModuleDependency(
"url",
[
{
name: "fileURLToPath",
value: URL_MODULE_CONSTANT_FUNCTION_NAME
}
],
undefined,
`${URL_MODULE_CONSTANT_FUNCTION_NAME}(${value()})`,
/** @type {Range} */ (expr.range),
`__webpack_${property}__`,
ExternalModuleDependency.PLACE_CHUNK
);
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
parser.state.module.addPresentationalDependency(dep);
@@ -300,20 +301,25 @@ class NodeStuffPlugin {
compilation.outputOptions;
if (
module &&
importMetaName === "import.meta" &&
(expressionName === "import.meta.filename" ||
expressionName === "import.meta.dirname") &&
environment.importMetaDirnameAndFilename
environment.importMetaDirnameAndFilename ||
(compiler.platform.web === null &&
compiler.platform.node === null &&
module)
) {
return `${property}: ${importMetaName}.${property},`;
const dep = new CachedConstDependency(
`${importMetaName}.${property}`,
null,
`__webpack_${property}__`,
CachedConstDependency.PLACE_CHUNK
);
dep.loc = /** @type {DependencyLocation} */ (
usingProperty.loc
);
parser.state.module.addPresentationalDependency(dep);
return `${property}: __webpack_${property}__,`;
}
if (environment.importMetaDirnameAndFilename) {
return `${property}: ${importMetaName}.${property},`;
}
const dep = new ExternalModuleInitFragmentDependency(
const dep = new ExternalModuleDependency(
"url",
[
{
@@ -321,13 +327,17 @@ class NodeStuffPlugin {
value: URL_MODULE_CONSTANT_FUNCTION_NAME
}
],
undefined
undefined,
`${URL_MODULE_CONSTANT_FUNCTION_NAME}(${value()})`,
null,
`__webpack_${property}__`,
ExternalModuleDependency.PLACE_CHUNK
);
dep.loc = /** @type {DependencyLocation} */ (usingProperty.loc);
parser.state.module.addPresentationalDependency(dep);
return `${property}: ${URL_MODULE_CONSTANT_FUNCTION_NAME}(${value()}),`;
return `${property}: __webpack_${property}__,`;
}
});
}