From a320be734ee5bcea3d36d3be41c7be28bb91ddd4 Mon Sep 17 00:00:00 2001 From: Joel Thiessen Date: Thu, 25 Mar 2021 13:11:36 -0700 Subject: [PATCH 1/2] Fix typo with import from app instead of App --- src/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index fb7b8a50ed8..0ee3f08e892 100644 --- a/src/index.js +++ b/src/index.js @@ -6,11 +6,13 @@ import { render } from '@wordpress/element'; /** * Internal dependencies */ -import { App } from './app'; +import { App } from './App'; import './index.scss'; -const appRoot = document.getElementById( 'woocommerce-admin-test-helper-app-root' ); +const appRoot = document.getElementById( + 'woocommerce-admin-test-helper-app-root' +); -if ( appRoot ) { - render( , appRoot ); -} \ No newline at end of file +if (appRoot) { + render(, appRoot); +} From 322dc12755a362f280f74bce61490ba6f0d29f82 Mon Sep 17 00:00:00 2001 From: Joel Thiessen Date: Tue, 30 Mar 2021 09:26:02 -0700 Subject: [PATCH 2/2] Renaming App to app, and including prettier deps --- package.json | 4 ++- src/{App => app}/app.js | 53 ++++++++++++++++++--------------------- src/{App => app}/index.js | 0 src/index.js | 2 +- 4 files changed, 29 insertions(+), 30 deletions(-) rename src/{App => app}/app.js (53%) rename src/{App => app}/index.js (100%) diff --git a/package.json b/package.json index f08b4aad5c8..6ecd47c8718 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,9 @@ "devDependencies": { "@woocommerce/dependency-extraction-webpack-plugin": "1.4.0", "@woocommerce/eslint-plugin": "1.1.0", - "@wordpress/scripts": "^13.0.3" + "@wordpress/prettier-config": "^1.0.1", + "@wordpress/scripts": "^13.0.3", + "prettier": "^2.2.1" }, "dependencies": { "@woocommerce/data": "^1.1.1", diff --git a/src/App/app.js b/src/app/app.js similarity index 53% rename from src/App/app.js rename to src/app/app.js index d6482f7213a..d437487ac12 100644 --- a/src/App/app.js +++ b/src/app/app.js @@ -11,26 +11,23 @@ import { AdminNotes } from '../admin-notes'; import { Tools } from '../tools'; import { default as Options } from '../options'; -const tabs = applyFilters( - 'woocommerce_admin_test_helper_tabs', - [ - { - name: 'options', - title: 'Options', - content: , - }, - { - name: 'admin-notes', - title: 'Admin notes', - content: , - }, - { - name: 'tools', - title: 'Tools', - content: , - }, - ] -); +const tabs = applyFilters('woocommerce_admin_test_helper_tabs', [ + { + name: 'options', + title: 'Options', + content: , + }, + { + name: 'admin-notes', + title: 'Admin notes', + content: , + }, + { + name: 'tools', + title: 'Tools', + content: , + }, +]); export function App() { return ( @@ -39,18 +36,18 @@ export function App() { - { ( tab ) => ( + {(tab) => ( <> - { tab.content } - { applyFilters( - `woocommerce_admin_test_helper_tab_${ tab.name }`, + {tab.content} + {applyFilters( + `woocommerce_admin_test_helper_tab_${tab.name}`, [] - ) } + )} - ) } + )} ); diff --git a/src/App/index.js b/src/app/index.js similarity index 100% rename from src/App/index.js rename to src/app/index.js diff --git a/src/index.js b/src/index.js index 0ee3f08e892..56be948f2cb 100644 --- a/src/index.js +++ b/src/index.js @@ -6,7 +6,7 @@ import { render } from '@wordpress/element'; /** * Internal dependencies */ -import { App } from './App'; +import { App } from './app'; import './index.scss'; const appRoot = document.getElementById(