Skip to content

Commit

Permalink
Prevent TypeError for projects without a local Prettier configuration (
Browse files Browse the repository at this point in the history
  • Loading branch information
ocean90 authored Sep 5, 2020
1 parent e56efc0 commit 458277c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/eslint-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

### Bug Fixes

- Fix TypeError for projects without a local Prettier configuration.

## 7.2.0 (2020-09-03)

### Enhancements

- The bundled `eslint-plugin-jsdoc` dependency has been updated from requiring `^26.0.0` to requiring `^30.2.2`.
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-plugin/configs/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const { cosmiconfigSync } = require( 'cosmiconfig' );
*/
const defaultPrettierConfig = require( '@wordpress/prettier-config' );

const { config: localPrettierConfig } = cosmiconfigSync( 'prettier' ).search();
const { config: localPrettierConfig } =
cosmiconfigSync( 'prettier' ).search() || {};
const prettierConfig = { ...defaultPrettierConfig, ...localPrettierConfig };

module.exports = {
Expand Down

0 comments on commit 458277c

Please sign in to comment.