Skip to content

Commit cd3b7ae

Browse files
committed
chore: run prettier on new files
1 parent 5c14a7c commit cd3b7ae

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1473,12 +1473,12 @@ module.exports = {
14731473
// synchronously write a .json mapping file in the same directory as the resource
14741474
const exportsJson = exports.reduce(
14751475
(acc, { name, value }) => ({ ...acc, [name]: value }),
1476-
{}
1476+
{},
14771477
);
14781478

14791479
const outputPath = path.resolve(
14801480
path.dirname(resourcePath),
1481-
`${path.basename(resourcePath)}.json`
1481+
`${path.basename(resourcePath)}.json`,
14821482
);
14831483

14841484
const fs = require("fs");
@@ -1503,12 +1503,12 @@ module.exports = {
15031503
getJSON: async ({ resourcePath, exports }) => {
15041504
const exportsJson = exports.reduce(
15051505
(acc, { name, value }) => ({ ...acc, [name]: value }),
1506-
{}
1506+
{},
15071507
);
15081508

15091509
const outputPath = path.resolve(
15101510
path.dirname(resourcePath),
1511-
`${path.basename(resourcePath)}.json`
1511+
`${path.basename(resourcePath)}.json`,
15121512
);
15131513

15141514
const fsp = require("fs/promises");
@@ -1548,15 +1548,15 @@ function addReplacements(resourcePath, imports, exportsJson, replacements) {
15481548
importReplacementsMap[resourcePath] = replacements.reduce(
15491549
(acc, { replacementName, importName, localName }) => {
15501550
const replacementImportUrl = imports.find(
1551-
(importData) => importData.importName === importName
1551+
(importData) => importData.importName === importName,
15521552
).url;
15531553
const relativePathRe = /.*!(.*)"/;
15541554
const [, relativePath] = replacementImportUrl.match(relativePathRe);
15551555
const importPath = path.resolve(path.dirname(resourcePath), relativePath);
15561556
const identifier = generateIdentifier(importPath, localName);
15571557
return { ...acc, [replacementName]: `___REPLACEMENT${identifier}___` };
15581558
},
1559-
{}
1559+
{},
15601560
);
15611561

15621562
// iterate through the raw exports and add stand-in variables
@@ -1572,7 +1572,7 @@ function addReplacements(resourcePath, imports, exportsJson, replacements) {
15721572
CSS_LOADER_REPLACEMENT_REGEX,
15731573
(_, replacementName) => {
15741574
return importReplacementsMap[resourcePath][replacementName];
1575-
}
1575+
},
15761576
);
15771577
} else {
15781578
// otherwise, no class names need replacements so we can add them to
@@ -1598,7 +1598,7 @@ function replaceReplacements(classNames) {
15981598
const canonicalValue = replaceReplacements(replacementsMap[identifier]);
15991599
canonicalValuesMap[identifier] = canonicalValue;
16001600
return canonicalValue;
1601-
}
1601+
},
16021602
);
16031603

16041604
return adjustedClassNames;
@@ -1615,7 +1615,7 @@ module.exports = {
16151615
getJSON: ({ resourcePath, imports, exports, replacements }) => {
16161616
const exportsJson = exports.reduce(
16171617
(acc, { name, value }) => ({ ...acc, [name]: value }),
1618-
{}
1618+
{},
16191619
);
16201620

16211621
if (replacements.length > 0) {
@@ -1625,7 +1625,7 @@ module.exports = {
16251625
resourcePath,
16261626
imports,
16271627
exportsJson,
1628-
replacements
1628+
replacements,
16291629
);
16301630
} else {
16311631
// no replacements present --> add to canonicalValuesMap verbatim
@@ -1649,7 +1649,7 @@ module.exports = {
16491649
apply(compiler) {
16501650
compiler.hooks.done.tap("CssModulesJsonPlugin", () => {
16511651
for (const [identifier, classNames] of Object.entries(
1652-
replacementsMap
1652+
replacementsMap,
16531653
)) {
16541654
const adjustedClassNames = replaceReplacements(classNames);
16551655
replacementsMap[identifier] = adjustedClassNames;
@@ -1662,7 +1662,7 @@ module.exports = {
16621662
fs.writeFileSync(
16631663
"./output.css.json",
16641664
JSON.stringify(allExportsJson, null, 2),
1665-
"utf8"
1665+
"utf8",
16661666
);
16671667
});
16681668
},

test/modules-option.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2621,10 +2621,10 @@ describe('"modules" option', () => {
26212621
expect(args).toMatchSnapshot("args");
26222622

26232623
expect(
2624-
getModuleSource("./modules/getJSON/source.css", stats)
2624+
getModuleSource("./modules/getJSON/source.css", stats),
26252625
).toMatchSnapshot("module");
26262626
expect(getExecutedCode("main.bundle.js", compiler, stats)).toMatchSnapshot(
2627-
"result"
2627+
"result",
26282628
);
26292629
expect(getWarnings(stats)).toMatchSnapshot("warnings");
26302630
expect(getErrors(stats)).toMatchSnapshot("errors");

0 commit comments

Comments
 (0)