Skip to content

Commit

Permalink
Merge pull request #14665 from markjm/markjm/option-names
Browse files Browse the repository at this point in the history
Fix names of options to match the exported types
  • Loading branch information
sokra committed Nov 8, 2021
2 parents 12e0285 + 0f22db9 commit 86e3eb2
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion lib/config/defaults.js
Expand Up @@ -449,7 +449,7 @@ const applyJavascriptParserOptionsDefaults = (
D(parserOptions, "wrappedContextRecursive", true);
D(parserOptions, "wrappedContextCritical", false);
D(parserOptions, "strictThisContextOnImports", false);
if (futureDefaults) D(parserOptions, "exportPresence", "error");
if (futureDefaults) D(parserOptions, "exportsPresence", "error");
};

/**
Expand Down
8 changes: 4 additions & 4 deletions lib/dependencies/HarmonyExportDependencyParserPlugin.js
Expand Up @@ -23,10 +23,10 @@ const { HarmonyStarExportsList } = HarmonyExportImportedSpecifierDependency;
module.exports = class HarmonyExportDependencyParserPlugin {
constructor(options) {
this.exportPresenceMode =
options.reexportExportPresence !== undefined
? ExportPresenceModes.fromUserOption(options.reexportExportPresence)
: options.exportPresence !== undefined
? ExportPresenceModes.fromUserOption(options.exportPresence)
options.reexportExportsPresence !== undefined
? ExportPresenceModes.fromUserOption(options.reexportExportsPresence)
: options.exportsPresence !== undefined
? ExportPresenceModes.fromUserOption(options.exportsPresence)
: options.strictExportPresence
? ExportPresenceModes.ERROR
: ExportPresenceModes.AUTO;
Expand Down
8 changes: 4 additions & 4 deletions lib/dependencies/HarmonyExportImportedSpecifierDependency.js
Expand Up @@ -755,8 +755,8 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
* @returns {WebpackError[]} warnings
*/
getWarnings(moduleGraph) {
const exportPresence = this._getEffectiveExportPresenceLevel(moduleGraph);
if (exportPresence === ExportPresenceModes.WARN) {
const exportsPresence = this._getEffectiveExportPresenceLevel(moduleGraph);
if (exportsPresence === ExportPresenceModes.WARN) {
return this._getErrors(moduleGraph);
}
return null;
Expand All @@ -768,8 +768,8 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
* @returns {WebpackError[]} errors
*/
getErrors(moduleGraph) {
const exportPresence = this._getEffectiveExportPresenceLevel(moduleGraph);
if (exportPresence === ExportPresenceModes.ERROR) {
const exportsPresence = this._getEffectiveExportPresenceLevel(moduleGraph);
if (exportsPresence === ExportPresenceModes.ERROR) {
return this._getErrors(moduleGraph);
}
return null;
Expand Down
8 changes: 4 additions & 4 deletions lib/dependencies/HarmonyImportDependencyParserPlugin.js
Expand Up @@ -67,10 +67,10 @@ module.exports = class HarmonyImportDependencyParserPlugin {
*/
constructor(options) {
this.exportPresenceMode =
options.importExportPresence !== undefined
? ExportPresenceModes.fromUserOption(options.importExportPresence)
: options.exportPresence !== undefined
? ExportPresenceModes.fromUserOption(options.exportPresence)
options.importExportsPresence !== undefined
? ExportPresenceModes.fromUserOption(options.importExportsPresence)
: options.exportsPresence !== undefined
? ExportPresenceModes.fromUserOption(options.exportsPresence)
: options.strictExportPresence
? ExportPresenceModes.ERROR
: ExportPresenceModes.AUTO;
Expand Down
8 changes: 4 additions & 4 deletions lib/dependencies/HarmonyImportSpecifierDependency.js
Expand Up @@ -173,8 +173,8 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
* @returns {WebpackError[]} warnings
*/
getWarnings(moduleGraph) {
const exportPresence = this._getEffectiveExportPresenceLevel(moduleGraph);
if (exportPresence === ExportPresenceModes.WARN) {
const exportsPresence = this._getEffectiveExportPresenceLevel(moduleGraph);
if (exportsPresence === ExportPresenceModes.WARN) {
return this._getErrors(moduleGraph);
}
return null;
Expand All @@ -186,8 +186,8 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
* @returns {WebpackError[]} errors
*/
getErrors(moduleGraph) {
const exportPresence = this._getEffectiveExportPresenceLevel(moduleGraph);
if (exportPresence === ExportPresenceModes.ERROR) {
const exportsPresence = this._getEffectiveExportPresenceLevel(moduleGraph);
if (exportsPresence === ExportPresenceModes.ERROR) {
return this._getErrors(moduleGraph);
}
return null;
Expand Down
2 changes: 1 addition & 1 deletion test/Defaults.unittest.js
Expand Up @@ -1939,7 +1939,7 @@ describe("Defaults", () => {
+ },
+ Object {
@@ ... @@
+ "exportPresence": "error",
+ "exportsPresence": "error",
@@ ... @@
- "__dirname": "mock",
- "__filename": "mock",
Expand Down
12 changes: 6 additions & 6 deletions test/configCases/compiletime/exports-presence/webpack.config.js
Expand Up @@ -6,27 +6,27 @@ module.exports = {
{
test: /aaa/,
parser: {
exportPresence: false
exportsPresence: false
}
},
{
test: /bbb/,
parser: {
exportPresence: "warn"
exportsPresence: "warn"
}
},
{
test: /ccc/,
parser: {
exportPresence: "error"
exportsPresence: "error"
}
},
{
test: /ddd/,
parser: {
exportPresence: "error",
importExportPresence: "warn",
reexportExportPresence: false
exportsPresence: "error",
importExportsPresence: "warn",
reexportExportsPresence: false
}
}
]
Expand Down

0 comments on commit 86e3eb2

Please sign in to comment.