Skip to content

Commit

Permalink
chore(deps): update dependency cosmiconfig to v8.2.0 (#14901)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
  • Loading branch information
renovate[bot] and fisker committed Jul 4, 2023
1 parent 25fa483 commit 1a0d9ed
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"ci-info": "3.8.0",
"cjk-regex": "2.0.1",
"collapse-white-space": "1.0.6",
"cosmiconfig": "8.0.0",
"cosmiconfig": "8.2.0",
"css-units-list": "2.0.1",
"dashify": "2.0.0",
"diff": "5.1.0",
Expand Down
9 changes: 0 additions & 9 deletions src/config/get-prettier-config-explorer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { pathToFileURL } from "node:url";
import parseToml from "@iarna/toml/parse-async.js";
import parseJson5 from "json5/lib/parse.js";
import mockable from "../common/mockable.js";
Expand All @@ -22,11 +21,6 @@ const searchPlaces = [
".prettierrc.toml",
];

async function loadJs(filepath /*, content*/) {
const module = await import(pathToFileURL(filepath).href);
return module.default;
}

const loaders = {
async ".toml"(filePath, content) {
try {
Expand All @@ -44,9 +38,6 @@ const loaders = {
throw error;
}
},
".js": loadJs,
".mjs": loadJs,
".cjs": loadJs,
};

async function transform(result) {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/__tests__/config-resolution.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ test(".js config file", async () => {
await expect(prettier.resolveConfig(file)).resolves.toMatchObject(config);
}

const cjsError = /module is not defined in ES module scope/;
const cjsError = /require\(\) of ES (?:Module|module)/;
for (const directoryName of [
"cjs-prettier-config-js-in-type-module",
"cjs-prettierrc-js-in-type-module",
Expand Down
14 changes: 13 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2798,6 +2798,18 @@ __metadata:
languageName: node
linkType: hard

"cosmiconfig@npm:8.2.0":
version: 8.2.0
resolution: "cosmiconfig@npm:8.2.0"
dependencies:
import-fresh: ^3.2.1
js-yaml: ^4.1.0
parse-json: ^5.0.0
path-type: ^4.0.0
checksum: 836d5d8efa750f3fb17b03d6ca74cd3154ed025dffd045304b3ef59637f662bde1e5dc88f8830080d180ec60841719cf4ea2ce73fb21ec694b16865c478ff297
languageName: node
linkType: hard

"cross-env@npm:7.0.3":
version: 7.0.3
resolution: "cross-env@npm:7.0.3"
Expand Down Expand Up @@ -6820,7 +6832,7 @@ __metadata:
ci-info: 3.8.0
cjk-regex: 2.0.1
collapse-white-space: 1.0.6
cosmiconfig: 8.0.0
cosmiconfig: 8.2.0
cross-env: 7.0.3
cspell: 6.31.1
css-units-list: 2.0.1
Expand Down

0 comments on commit 1a0d9ed

Please sign in to comment.