Skip to content

Commit

Permalink
Update function signature
Browse files Browse the repository at this point in the history
  • Loading branch information
beerose committed May 31, 2023
1 parent eb460c6 commit 589e07a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 8.1.4

- **Breaking change:** Add support for ECMAScript modules (ESM) to the [*asynchronous* API](./README.md#asynchronous-api). End users running Node versions that support ESM can provide `.mjs` files, or `.js` files whose nearest parent `package.json` file contains `"type": "module"`.
- Add support for ECMAScript modules (ESM) to the [*asynchronous* API](./README.md#asynchronous-api). End users running Node versions that support ESM can provide `.mjs` files, or `.js` files whose nearest parent `package.json` file contains `"type": "module"`.
- `${moduleName}rc.mjs` and `${moduleName}.config.mjs` are included in the default `searchPlaces` of the asynchronous API.
- The [synchronous API](./README.md#synchronous-api) does not support ECMAScript modules, so does not look for `.mjs` files.
- To learn more, read ["Loading JS modules"](./README.md#loading-js-modules).
Expand Down Expand Up @@ -31,6 +31,7 @@
- **Breaking change:** Drop support for Node 10 and 12.

- **Breaking change:** Use npm package [js-yaml](https://www.npmjs.com/package/js-yaml) to parse YAML instead of npm package [yaml](https://www.npmjs.com/package/yaml).

- Added: Loader errors now include the path of the file that was tried to be loaded.

## 7.1.0
Expand Down
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
"check:all": "npm run test && npm run typescript && npm run lint && npm run format:check",
"prepublishOnly": "npm run check:all && npm run build"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged && npm run typescript && npm run test",
"pre-push": "npm run check:all"
}
},
"lint-staged": {
"*.{js,ts}": [
"eslint --fix",
Expand Down Expand Up @@ -89,10 +95,10 @@
"path-type": "^4.0.0"
},
"devDependencies": {
"@babel/cli": "7.19.3",
"@babel/core": "7.20.2",
"@babel/preset-env": "7.20.2",
"@babel/preset-typescript": "7.18.6",
"@babel/cli": "^7.19.3",
"@babel/core": "^7.20.2",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@types/js-yaml": "^4.0.5",
"@types/node": "^14.0.22",
"@types/parse-json": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/ExplorerBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class ExplorerBase<T extends ExplorerOptions | ExplorerOptionsSync> {
return nextDir;
}

private loadPackageProp(filepath: string, content: string | null): unknown {
private loadPackageProp(filepath: string, content: string): unknown {
const parsedContent = loaders.loadJson(filepath, content);
const packagePropValue = getPropertyByPath(
parsedContent,
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function getExplorerOptions<T extends Options | OptionsSync>(
searchPlaces: metaSearchPlaces,
ignoreEmptySearchPlaces: false,
usePackagePropInConfigFiles: true,
loaders: { ...defaultLoadersSync, ...defaultLoaders },
loaders: defaultLoaders,
transform: identity,
cache: true,
metaConfigFilePath: null,
Expand Down

0 comments on commit 589e07a

Please sign in to comment.