Skip to content

Instantly share code, notes, and snippets.

@Aljullu
Created December 17, 2019 09:51
Show Gist options
  • Save Aljullu/2ac90ed4b068a6bc721619ece5e5d0aa to your computer and use it in GitHub Desktop.
Save Aljullu/2ac90ed4b068a6bc721619ece5e5d0aa to your computer and use it in GitHub Desktop.
prettier.diff
diff --git a/assets/js/base/components/checkbox-list/index.js b/assets/js/base/components/checkbox-list/index.js
index d36b116..c540916 100644
--- a/assets/js/base/components/checkbox-list/index.js
+++ b/assets/js/base/components/checkbox-list/index.js
@@ -99,9 +99,9 @@ const CheckboxList = ( {
{ options.map( ( option, index ) => (
<Fragment key={ option.value }>
<li
- { ...shouldTruncateOptions &&
+ { ...( shouldTruncateOptions &&
! showExpanded &&
- index >= limit && { hidden: true } }
+ index >= limit && { hidden: true } ) }
>
<input
type="checkbox"
diff --git a/assets/js/components/product-control/index.js b/assets/js/components/product-control/index.js
index bc08893..a376901 100644
--- a/assets/js/components/product-control/index.js
+++ b/assets/js/components/product-control/index.js
@@ -89,9 +89,9 @@ const ProductControl = ( {
};
if ( item.breadcrumbs.length ) {
- a11yProps[ 'aria-label' ] = `${ item.breadcrumbs[ 0 ] }: ${
- item.name
- }`;
+ a11yProps[
+ 'aria-label'
+ ] = `${ item.breadcrumbs[ 0 ] }: ${ item.name }`;
}
if ( variationsCount ) {
diff --git a/assets/js/components/toggle-button-control/index.js b/assets/js/components/toggle-button-control/index.js
index 2bca473..50e2368 100644
--- a/assets/js/components/toggle-button-control/index.js
+++ b/assets/js/components/toggle-button-control/index.js
@@ -74,9 +74,7 @@ class ToggleButtonControl extends Component {
return (
<Button
- key={ `${ option.label }-${
- option.value
- }-${ index }` }
+ key={ `${ option.label }-${ option.value }-${ index }` }
value={ option.value }
onClick={ this.onClick }
aria-label={ label + ': ' + option.label }
diff --git a/assets/js/hocs/test/with-searched-products.js b/assets/js/hocs/test/with-searched-products.js
index 9f4ccbd..880abe1 100644
--- a/assets/js/hocs/test/with-searched-products.js
+++ b/assets/js/hocs/test/with-searched-products.js
@@ -15,14 +15,12 @@ jest.mock( '@woocommerce/block-settings', () => ( {
} ) );
// Mock the getProducts and isLargeCatalog values for tests.
-mockedUtils.getProducts = jest
- .fn()
- .mockImplementation( () =>
- Promise.resolve( [
- { id: 10, name: 'foo', parent: 0 },
- { id: 20, name: 'bar', parent: 0 },
- ] )
- );
+mockedUtils.getProducts = jest.fn().mockImplementation( () =>
+ Promise.resolve( [
+ { id: 10, name: 'foo', parent: 0 },
+ { id: 20, name: 'bar', parent: 0 },
+ ] )
+);
// Add a mock implementation of debounce for testing so we can spy on
// the onSearch call.
diff --git a/bin/fallback-module-directory-webpack-plugin.js b/bin/fallback-module-directory-webpack-plugin.js
index 5fe3480..b7d0337 100644
--- a/bin/fallback-module-directory-webpack-plugin.js
+++ b/bin/fallback-module-directory-webpack-plugin.js
@@ -86,9 +86,7 @@ module.exports = class FallbackModuleDirectoryWebpackPlugin {
return resolver.doResolve(
target,
obj,
- `aliased with mapping '${
- item.name
- }' to '${ newRequestStr }'`,
+ `aliased with mapping '${ item.name }' to '${ newRequestStr }'`,
resolveContext,
( err, result ) => {
if ( err ) return callback( err );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment