Skip to content

Commit

Permalink
fix: support windows absolute extends (#3062)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerlox committed Nov 17, 2023
1 parent 26df1d2 commit 0d06f62
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
16 changes: 3 additions & 13 deletions lib/get-config.js
@@ -1,10 +1,10 @@
import { dirname, extname } from "node:path";
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";

import { castArray, isNil, isPlainObject, isString, pickBy } from "lodash-es";
import { readPackageUp } from "read-pkg-up";
import { cosmiconfig } from "cosmiconfig";
import resolveFrom from "resolve-from";
import importFrom from "import-from-esm";
import debugConfig from "debug";
import { repoUrl } from "./git.js";
import PLUGINS_DEFINITIONS from "./definitions/plugins.js";
Expand Down Expand Up @@ -33,17 +33,7 @@ export default async (context, cliOptions) => {
options = {
...(await castArray(extendPaths).reduce(async (eventualResult, extendPath) => {
const result = await eventualResult;
const resolvedPath = resolveFrom.silent(__dirname, extendPath) || resolveFrom(cwd, extendPath);
const importAssertions =
extname(resolvedPath) === ".json"
? {
assert: {
type: "json",
},
}
: undefined;

const { default: extendsOptions } = await import(resolvedPath, importAssertions);
const extendsOptions = (await importFrom.silent(__dirname, extendPath)) || (await importFrom(cwd, extendPath));

// For each plugin defined in a shareable config, save in `pluginsPath` the extendable config path,
// so those plugin will be loaded relative to the config file
Expand Down
22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -43,6 +43,7 @@
"git-log-parser": "^1.2.0",
"hook-std": "^3.0.0",
"hosted-git-info": "^7.0.0",
"import-from-esm": "^1.3.1",
"lodash-es": "^4.17.21",
"marked": "^9.0.0",
"marked-terminal": "^6.0.0",
Expand Down

0 comments on commit 0d06f62

Please sign in to comment.