From f4e07f528cc407097ad9db2f7bf1a8683a87e700 Mon Sep 17 00:00:00 2001 From: Scott Rees <6165315+reesscot@users.noreply.github.com> Date: Thu, 15 Jul 2021 09:02:40 -0700 Subject: [PATCH] Setup prettier to run on pre-commit (#93) --- .husky/.gitignore | 1 + .husky/pre-commit | 4 + .prettierignore | 2 + angular-docs/e2e/protractor.conf.js | 34 +++---- angular-docs/e2e/src/app.e2e-spec.ts | 8 +- angular-docs/karma.conf.js | 33 +++---- angular-docs/src/app/app.component.css | 2 +- angular-docs/src/app/app.module.ts | 6 +- angular-docs/src/app/common/routes.ts | 12 +-- .../basic-authenticator.component.ts | 2 +- .../custom-form-authenticator.component.ts | 4 +- .../headless-authenticator.component.ts | 2 +- .../on-submit-authenticator.component.ts | 4 +- .../src/environments/environment.prod.ts | 2 +- angular-docs/src/environments/environment.ts | 2 +- angular-docs/src/main.ts | 2 +- .../authenticator/basic-authenticator.md | 2 +- .../markdowns/authenticator/custom-form.md | 2 +- .../authenticator/headless-authenticator.md | 2 - .../src/markdowns/authenticator/on-submit.md | 12 +-- angular-docs/src/test.ts | 8 +- docs/next.config.js | 4 +- docs/postcss.config.js | 2 +- docs/src/components/DividerPropControls.tsx | 4 +- docs/src/components/Feature.tsx | 4 +- docs/src/components/Layout.tsx | 6 +- docs/src/components/customComponents.tsx | 2 +- docs/src/components/useDividerProps.tsx | 2 +- docs/src/components/useImageProps.tsx | 2 +- docs/src/components/useStyleProps.tsx | 2 +- docs/src/data/pages.preval.ts | 2 +- docs/src/pages/ui/primitives/button/demo.tsx | 4 +- docs/src/pages/ui/primitives/button/index.mdx | 92 ++++++++++++------- docs/src/pages/ui/primitives/flex/demo.tsx | 43 ++++++--- docs/src/pages/ui/primitives/text/demo.tsx | 14 +-- docs/src/pages/ui/primitives/view/demo.tsx | 7 +- docs/src/pages/ui/primitives/view/index.mdx | 34 ++----- docs/src/plugins/remark-layout.js | 2 +- docs/src/utils/getContentPaths.tsx | 2 +- .../sign-in/auth-with-sms-mfa.tsx | 2 +- package.json | 11 ++- packages/angular/README.md | 5 +- .../angular/projects/ui-angular/karma.conf.js | 24 ++--- .../ui-angular/src/lib/common/helpers.ts | 12 +-- .../src/lib/common/types/common-types.ts | 4 +- .../amplify-authenticator.component.ts | 18 ++-- .../amplify-confirm-sign-up.component.ts | 20 ++-- .../amplify-sign-in.component.ts | 17 ++-- .../amplify-sign-out.component.ts | 2 +- .../amplify-sign-up.component.ts | 17 ++-- .../amplify-input/amplify-input.component.ts | 8 +- .../amplify-validation-error.component.ts | 2 +- .../services/authenticator-context.service.ts | 2 +- .../src/lib/services/state-machine.service.ts | 10 +- .../ui-angular/src/lib/ui-angular.module.ts | 6 +- .../angular/projects/ui-angular/src/test.ts | 8 +- packages/core/.eslintrc.js | 8 +- packages/core/src/validators/index.ts | 4 +- packages/e2e/README.md | 16 ++-- .../authenticator/sign-up/sign-up.steps.ts | 8 +- packages/e2e/cypress/support/index.js | 2 +- .../amplify/README.md | 2 + .../LaunchImage.imageset/README.md | 2 +- .../LaunchImage.imageset/README.md | 2 +- .../ConfirmSignIn/ConfirmSignIn.tsx | 2 +- .../ConfirmSignUp/ConfirmSignUp.tsx | 2 +- .../Authenticator/SetupTOTP/SetupTOTP.tsx | 2 +- .../Authenticator/SignIn/SignIn.tsx | 2 +- .../Authenticator/SignUp/SignUp.tsx | 4 +- .../src/components/Authenticator/index.tsx | 2 +- .../Authenticator/shared/UserNameAlias.tsx | 2 +- .../react/src/primitives/Divider/Divider.tsx | 2 +- .../react/src/primitives/Divider/index.ts | 2 +- packages/react/src/primitives/Flex/Flex.tsx | 5 +- packages/react/src/primitives/Image/Image.tsx | 2 +- packages/react/src/primitives/Image/index.ts | 2 +- packages/react/src/primitives/Text/Text.tsx | 2 +- packages/react/src/primitives/View/View.tsx | 2 +- .../shared/__tests__/utils.test.tsx | 2 +- packages/react/src/primitives/shared/utils.ts | 21 +++-- .../react/src/primitives/types/divider.ts | 5 +- packages/react/src/primitives/types/flex.ts | 8 +- packages/react/src/primitives/types/image.ts | 5 +- packages/react/src/primitives/types/index.ts | 12 +-- packages/react/src/primitives/types/style.ts | 13 ++- packages/react/src/primitives/types/view.ts | 7 +- packages/vue/.eslintrc.js | 18 ++-- packages/vue/src/composables/useAuth.ts | 8 +- postcss.config.js | 4 +- vue-docs/.eslintrc.js | 10 +- vue-docs/README.md | 5 + vue-docs/babel.config.js | 6 +- vue-docs/postcss.config.js | 4 +- vue-docs/src/shims-vue.d.ts | 9 +- vue-docs/src/utils/code-examples.js | 2 +- vue-docs/tailwind.config.js | 6 +- yarn.lock | 76 ++++++++++++++- 97 files changed, 491 insertions(+), 349 deletions(-) create mode 100644 .husky/.gitignore create mode 100755 .husky/pre-commit create mode 100644 .prettierignore diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 00000000000..31354ec1389 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000000..36af219892f --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000000..209af13c738 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +.next +.husky diff --git a/angular-docs/e2e/protractor.conf.js b/angular-docs/e2e/protractor.conf.js index 361e7f0cdfa..355ba2c1a20 100644 --- a/angular-docs/e2e/protractor.conf.js +++ b/angular-docs/e2e/protractor.conf.js @@ -2,36 +2,36 @@ // Protractor configuration file, see link for more information // https://github.com/angular/protractor/blob/master/lib/config.ts -const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter'); +const { SpecReporter, StacktraceOption } = require("jasmine-spec-reporter"); /** * @type { import("protractor").Config } */ exports.config = { allScriptsTimeout: 11000, - specs: [ - './src/**/*.e2e-spec.ts' - ], + specs: ["./src/**/*.e2e-spec.ts"], capabilities: { - browserName: 'chrome' + browserName: "chrome", }, directConnect: true, SELENIUM_PROMISE_MANAGER: false, - baseUrl: 'http://localhost:4200/', - framework: 'jasmine', + baseUrl: "http://localhost:4200/", + framework: "jasmine", jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 30000, - print: function() {} + print: function () {}, }, onPrepare() { - require('ts-node').register({ - project: require('path').join(__dirname, './tsconfig.json') + require("ts-node").register({ + project: require("path").join(__dirname, "./tsconfig.json"), }); - jasmine.getEnv().addReporter(new SpecReporter({ - spec: { - displayStacktrace: StacktraceOption.PRETTY - } - })); - } -}; \ No newline at end of file + jasmine.getEnv().addReporter( + new SpecReporter({ + spec: { + displayStacktrace: StacktraceOption.PRETTY, + }, + }) + ); + }, +}; diff --git a/angular-docs/e2e/src/app.e2e-spec.ts b/angular-docs/e2e/src/app.e2e-spec.ts index 59e171c4822..b3f8b7781dc 100644 --- a/angular-docs/e2e/src/app.e2e-spec.ts +++ b/angular-docs/e2e/src/app.e2e-spec.ts @@ -16,8 +16,10 @@ describe('workspace-project App', () => { afterEach(async () => { // Assert that there are no errors emitted from the browser const logs = await browser.manage().logs().get(logging.Type.BROWSER); - expect(logs).not.toContain(jasmine.objectContaining({ - level: logging.Level.SEVERE, - } as logging.Entry)); + expect(logs).not.toContain( + jasmine.objectContaining({ + level: logging.Level.SEVERE, + } as logging.Entry) + ); }); }); diff --git a/angular-docs/karma.conf.js b/angular-docs/karma.conf.js index 0512dcc2ef2..ae762fd9c97 100644 --- a/angular-docs/karma.conf.js +++ b/angular-docs/karma.conf.js @@ -3,14 +3,14 @@ module.exports = function (config) { config.set({ - basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], + basePath: "", + frameworks: ["jasmine", "@angular-devkit/build-angular"], plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage'), - require('@angular-devkit/build-angular/plugins/karma') + require("karma-jasmine"), + require("karma-chrome-launcher"), + require("karma-jasmine-html-reporter"), + require("karma-coverage"), + require("@angular-devkit/build-angular/plugins/karma"), ], client: { jasmine: { @@ -19,26 +19,23 @@ module.exports = function (config) { // for example, you can disable the random execution with `random: false` // or set a specific seed with `seed: 4321` }, - clearContext: false // leave Jasmine Spec Runner output visible in browser + clearContext: false, // leave Jasmine Spec Runner output visible in browser }, jasmineHtmlReporter: { - suppressAll: true // removes the duplicated traces + suppressAll: true, // removes the duplicated traces }, coverageReporter: { - dir: require('path').join(__dirname, './coverage/angular-docs'), - subdir: '.', - reporters: [ - { type: 'html' }, - { type: 'text-summary' } - ] + dir: require("path").join(__dirname, "./coverage/angular-docs"), + subdir: ".", + reporters: [{ type: "html" }, { type: "text-summary" }], }, - reporters: ['progress', 'kjhtml'], + reporters: ["progress", "kjhtml"], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, - browsers: ['Chrome'], + browsers: ["Chrome"], singleRun: false, - restartOnFileChange: true + restartOnFileChange: true, }); }; diff --git a/angular-docs/src/app/app.component.css b/angular-docs/src/app/app.component.css index aa7a86a8163..315a5467ce4 100644 --- a/angular-docs/src/app/app.component.css +++ b/angular-docs/src/app/app.component.css @@ -15,4 +15,4 @@ mat-sidenav-container { mat-sidenav { position: fixed !important; top: 64px !important; -} \ No newline at end of file +} diff --git a/angular-docs/src/app/app.module.ts b/angular-docs/src/app/app.module.ts index 7305139a8b5..02aecf5f8fd 100644 --- a/angular-docs/src/app/app.module.ts +++ b/angular-docs/src/app/app.module.ts @@ -30,7 +30,7 @@ import { CustomFormAuthenticatorComponent } from './pages/custom-form-authentica CustomComponentAuthenticatorComponent, CompositionAuthenticatorComponent, OnSubmitAuthenticatorComponent, - CustomFormAuthenticatorComponent + CustomFormAuthenticatorComponent, ], imports: [ UiAngularModule, @@ -43,9 +43,9 @@ import { CustomFormAuthenticatorComponent } from './pages/custom-form-authentica MatButtonModule, MatIconModule, MatSidenavModule, - MatListModule + MatListModule, ], providers: [], - bootstrap: [AppComponent] + bootstrap: [AppComponent], }) export class AppModule {} diff --git a/angular-docs/src/app/common/routes.ts b/angular-docs/src/app/common/routes.ts index e599ceb0159..547ab7ea190 100644 --- a/angular-docs/src/app/common/routes.ts +++ b/angular-docs/src/app/common/routes.ts @@ -11,22 +11,22 @@ export const docRoutes: DocRoutes = [ { path: 'basic-authenticator', name: 'Basic Authenticator', - component: BasicAuthenticatorComponent + component: BasicAuthenticatorComponent, }, { path: 'styled-authenticator', name: 'Styling Components', - component: StyledAuthenticatorComponent + component: StyledAuthenticatorComponent, }, { path: 'headless-authenticator', name: 'Headless Authenticator', - component: HeadlessAuthenticatorComponent + component: HeadlessAuthenticatorComponent, }, { path: 'custom-authenticator', name: 'Inserting Custom Components', - component: CustomComponentAuthenticatorComponent + component: CustomComponentAuthenticatorComponent, }, // { // path: 'on-submit-hook', @@ -36,8 +36,8 @@ export const docRoutes: DocRoutes = [ { path: 'custom-form', name: 'Custom Form Validation', - component: CustomFormAuthenticatorComponent - } + component: CustomFormAuthenticatorComponent, + }, // { // path: 'composition', // name: 'Composing components', diff --git a/angular-docs/src/app/pages/basic-authenticator/basic-authenticator.component.ts b/angular-docs/src/app/pages/basic-authenticator/basic-authenticator.component.ts index 296ec109d4d..32b107f97e7 100644 --- a/angular-docs/src/app/pages/basic-authenticator/basic-authenticator.component.ts +++ b/angular-docs/src/app/pages/basic-authenticator/basic-authenticator.component.ts @@ -3,6 +3,6 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-basic-authenticator', templateUrl: './basic-authenticator.component.html', - styleUrls: [] + styleUrls: [], }) export class BasicAuthenticatorComponent {} diff --git a/angular-docs/src/app/pages/custom-form-authenticator/custom-form-authenticator.component.ts b/angular-docs/src/app/pages/custom-form-authenticator/custom-form-authenticator.component.ts index 82833d5c68a..7608433cf54 100644 --- a/angular-docs/src/app/pages/custom-form-authenticator/custom-form-authenticator.component.ts +++ b/angular-docs/src/app/pages/custom-form-authenticator/custom-form-authenticator.component.ts @@ -4,12 +4,12 @@ import { StateMachineService } from '@aws-amplify/ui-angular'; @Component({ selector: 'app-custom-form-authenticator', templateUrl: './custom-form-authenticator.component.html', - styleUrls: ['./custom-form-authenticator.component.css'] + styleUrls: ['./custom-form-authenticator.component.css'], }) export class CustomFormAuthenticatorComponent { constructor(private authService: StateMachineService) {} public error = { - passwordMismatch: true + passwordMismatch: true, }; public onInput($event) { diff --git a/angular-docs/src/app/pages/headless-authenticator/headless-authenticator.component.ts b/angular-docs/src/app/pages/headless-authenticator/headless-authenticator.component.ts index dc4d7bebc53..e878a4f0eea 100644 --- a/angular-docs/src/app/pages/headless-authenticator/headless-authenticator.component.ts +++ b/angular-docs/src/app/pages/headless-authenticator/headless-authenticator.component.ts @@ -2,6 +2,6 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-headless-authenticator', - templateUrl: './headless-authenticator.component.html' + templateUrl: './headless-authenticator.component.html', }) export class HeadlessAuthenticatorComponent {} diff --git a/angular-docs/src/app/pages/on-submit-authenticator/on-submit-authenticator.component.ts b/angular-docs/src/app/pages/on-submit-authenticator/on-submit-authenticator.component.ts index 9589fd5302a..5daabdd0af3 100644 --- a/angular-docs/src/app/pages/on-submit-authenticator/on-submit-authenticator.component.ts +++ b/angular-docs/src/app/pages/on-submit-authenticator/on-submit-authenticator.component.ts @@ -2,12 +2,12 @@ import { Component, OnInit } from '@angular/core'; import { FormError, AuthFormData, - OnSubmitHookResponse + OnSubmitHookResponse, } from '@aws-amplify/ui-angular'; @Component({ selector: 'app-custom-form-authenticator', - templateUrl: './on-submit-authenticator.component.html' + templateUrl: './on-submit-authenticator.component.html', }) export class OnSubmitAuthenticatorComponent { public trimUsername(formData: AuthFormData): void { diff --git a/angular-docs/src/environments/environment.prod.ts b/angular-docs/src/environments/environment.prod.ts index 3612073bc31..c9669790be1 100644 --- a/angular-docs/src/environments/environment.prod.ts +++ b/angular-docs/src/environments/environment.prod.ts @@ -1,3 +1,3 @@ export const environment = { - production: true + production: true, }; diff --git a/angular-docs/src/environments/environment.ts b/angular-docs/src/environments/environment.ts index 7b4f817adb7..99c3763cad6 100644 --- a/angular-docs/src/environments/environment.ts +++ b/angular-docs/src/environments/environment.ts @@ -3,7 +3,7 @@ // The list of file replacements can be found in `angular.json`. export const environment = { - production: false + production: false, }; /* diff --git a/angular-docs/src/main.ts b/angular-docs/src/main.ts index 03632aa9bcf..07388214e7c 100644 --- a/angular-docs/src/main.ts +++ b/angular-docs/src/main.ts @@ -16,4 +16,4 @@ if (environment.production) { platformBrowserDynamic() .bootstrapModule(AppModule) - .catch(err => console.error(err)); + .catch((err) => console.error(err)); diff --git a/angular-docs/src/markdowns/authenticator/basic-authenticator.md b/angular-docs/src/markdowns/authenticator/basic-authenticator.md index 10269eb9014..b34ff9a72a8 100644 --- a/angular-docs/src/markdowns/authenticator/basic-authenticator.md +++ b/angular-docs/src/markdowns/authenticator/basic-authenticator.md @@ -9,7 +9,7 @@ Amplify provides simple, clean styles to get started with a great experience in 1. Inside your `style.css`, import the shared css module: ```css -@import '~@aws-amplify/ui-angular/theme.css'; +@import "~@aws-amplify/ui-angular/theme.css"; ``` 2. Wrap your app with `amplify-context-provider`: diff --git a/angular-docs/src/markdowns/authenticator/custom-form.md b/angular-docs/src/markdowns/authenticator/custom-form.md index 707fd65e788..026a5e758f2 100644 --- a/angular-docs/src/markdowns/authenticator/custom-form.md +++ b/angular-docs/src/markdowns/authenticator/custom-form.md @@ -47,7 +47,7 @@ import { AmplifyAuthService } from "@aws-amplify/ui-angular"; @Component({ selector: "app-custom-form-authenticator", templateUrl: "./custom-form-authenticator.component.html", - styleUrls: ["./custom-form-authenticator.component.css"] + styleUrls: ["./custom-form-authenticator.component.css"], }) export class CustomFormAuthenticatorComponent { // authService provides helper services like submit event emitters. diff --git a/angular-docs/src/markdowns/authenticator/headless-authenticator.md b/angular-docs/src/markdowns/authenticator/headless-authenticator.md index 85e9c25450f..30106a14525 100644 --- a/angular-docs/src/markdowns/authenticator/headless-authenticator.md +++ b/angular-docs/src/markdowns/authenticator/headless-authenticator.md @@ -5,5 +5,3 @@ If you do not have the top level `amplify-context-provider`, you will get a _hea ```html ``` - - diff --git a/angular-docs/src/markdowns/authenticator/on-submit.md b/angular-docs/src/markdowns/authenticator/on-submit.md index c4a97eb9bbc..3ffa1652313 100644 --- a/angular-docs/src/markdowns/authenticator/on-submit.md +++ b/angular-docs/src/markdowns/authenticator/on-submit.md @@ -7,9 +7,7 @@ `onSubmit` hooks have the following shape: ```typescript -type OnSubmitHook = ( - formData: AuthFormData -) => { +type OnSubmitHook = (formData: AuthFormData) => { data?: AuthFormData; error?: FormError; }; @@ -22,7 +20,7 @@ type OnSubmitHook = ( ```ts const formData = { username: "amplify", - password: "myPassword" + password: "myPassword", }; ``` @@ -35,15 +33,15 @@ Your `onSubmit` hook can output either `error` or `data` object based on your ne - If you have any validation errors you want to report, you should return an object with `error` field. This is a map of each input name to its error messages. For example, let's create a validation hook that checks whether username has at least one digit. ```typescript -import { OnSubmitHook, AuthFormData } from '@aws-amplify/ui-angular' +import { OnSubmitHook, AuthFormData } from "@aws-amplify/ui-angular"; const onSignUp: OnSubmitHook = (formData: AuthFormData) => { const { username } = formData; - const error: FormError = {} + const error: FormError = {}; const containsDigit = /\d/.test(username); if (!containsDigit) { - error.username = ['This field should contain at least one digit.']; + error.username = ["This field should contain at least one digit."]; } return { error }; diff --git a/angular-docs/src/test.ts b/angular-docs/src/test.ts index 50193eb0f28..bb60ce8db4d 100644 --- a/angular-docs/src/test.ts +++ b/angular-docs/src/test.ts @@ -4,11 +4,15 @@ import 'zone.js/dist/zone-testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, - platformBrowserDynamicTesting + platformBrowserDynamicTesting, } from '@angular/platform-browser-dynamic/testing'; declare const require: { - context(path: string, deep?: boolean, filter?: RegExp): { + context( + path: string, + deep?: boolean, + filter?: RegExp + ): { keys(): string[]; (id: string): T; }; diff --git a/docs/next.config.js b/docs/next.config.js index 8ba3bb83dca..d9097e88080 100644 --- a/docs/next.config.js +++ b/docs/next.config.js @@ -1,9 +1,7 @@ const { execSync } = require("child_process"); const path = require("path"); -const gitHead = execSync("git rev-parse --abbrev-ref HEAD") - .toString() - .trim(); +const gitHead = execSync("git rev-parse --abbrev-ref HEAD").toString().trim(); const BRANCH = gitHead === "HEAD" ? "main" : gitHead; diff --git a/docs/postcss.config.js b/docs/postcss.config.js index 33ad091d26d..12a703d900d 100644 --- a/docs/postcss.config.js +++ b/docs/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -} +}; diff --git a/docs/src/components/DividerPropControls.tsx b/docs/src/components/DividerPropControls.tsx index 09c87db7c91..e00473b4726 100644 --- a/docs/src/components/DividerPropControls.tsx +++ b/docs/src/components/DividerPropControls.tsx @@ -28,7 +28,7 @@ export const DividerPropControls: DividerPropControlsInterface = ({ name="size" id="size" value={size} - onChange={event => + onChange={(event) => setSize(event.target.value as DividerOptions["size"]) } > @@ -43,7 +43,7 @@ export const DividerPropControls: DividerPropControlsInterface = ({ name="orientation" id="orientation" value={orientation} - onChange={event => + onChange={(event) => setOrientation( event.target.value as DividerOptions["orientation"] ) diff --git a/docs/src/components/Feature.tsx b/docs/src/components/Feature.tsx index d6fa8a88980..1449190b660 100644 --- a/docs/src/components/Feature.tsx +++ b/docs/src/components/Feature.tsx @@ -18,7 +18,7 @@ const parser = new Parser( new GherkinClassicTokenMatcher() // or GherkinInMarkdownTokenMatcher() ); -const required = message => { +const required = (message) => { throw new Error(message); }; @@ -32,7 +32,7 @@ export function Feature({ useEffect(() => { import( `raw-loader!../../../packages/e2e/cypress/integration${asPath}/${name}.feature` - ).then(exports => setSource(exports.default)); + ).then((exports) => setSource(exports.default)); }, [asPath, name]); if (!source) { diff --git a/docs/src/components/Layout.tsx b/docs/src/components/Layout.tsx index e4d3d245ed9..7d55677c115 100644 --- a/docs/src/components/Layout.tsx +++ b/docs/src/components/Layout.tsx @@ -54,7 +54,7 @@ export default function Layout({ const { platform } = router.query as { platform: string }; const groupedPages = Object.entries( - groupBy(pages, page => { + groupBy(pages, (page) => { const [, folder = ""] = page.slug.split("/"); return folder; }) @@ -68,7 +68,7 @@ export default function Layout({ "#__next > section:first-of-type h3", ].join(",") ), - ].map(node => [node.innerHTML, node.tagName.toLowerCase()]); + ].map((node) => [node.innerHTML, node.tagName.toLowerCase()]); setHeaders(htmlHeaders); }, [children]); @@ -149,7 +149,7 @@ export default function Layout({ )} - {pages.map(page => + {pages.map((page) => folder ? ( ); }, - "Authenticator.SignUp.Button": props => { + "Authenticator.SignUp.Button": (props) => { return props.type === "submit" ? (