From 09abf46892f5df2ca78cd9de93a2047894f50e7d Mon Sep 17 00:00:00 2001 From: vicky-comeau Date: Fri, 19 Apr 2024 15:40:40 -0400 Subject: [PATCH] Fix: Updated the plop templates to follow linting rules --- .../components/docs/{{ pascalCase name }}.stories.tsx.hbs | 7 ++++--- .../components/src/{{ pascalCase name }}.tsx.hbs | 3 ++- .../components/src/{{ pascalCase name }}Context.ts.hbs | 1 + .../tests/chromatic/{{ pascalCase name }}.stories.tsx.hbs | 7 ++++--- .../tests/jest/{{ pascalCase name }}.ssr.test.tsx.hbs | 3 ++- .../tests/jest/{{ pascalCase name }}.test.tsx.hbs | 3 ++- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/plop-templates/components/docs/{{ pascalCase name }}.stories.tsx.hbs b/plop-templates/components/docs/{{ pascalCase name }}.stories.tsx.hbs index d3a4ebb68..81051f0e0 100644 --- a/plop-templates/components/docs/{{ pascalCase name }}.stories.tsx.hbs +++ b/plop-templates/components/docs/{{ pascalCase name }}.stories.tsx.hbs @@ -1,6 +1,7 @@ -import { {{ pascalCase name }} } from "../src/{{ pascalCase name }}.tsx"; import type { Meta, StoryObj } from "@storybook/react"; +import { {{ pascalCase name }} } from "../src/{{ pascalCase name }}.tsx"; + /** * TODO: Add description * @@ -27,5 +28,5 @@ type Story = StoryObj; /** * TODO: Add description */ -export const Default: Story = { -}; +export const Default = { +} satisfies Story; diff --git a/plop-templates/components/src/{{ pascalCase name }}.tsx.hbs b/plop-templates/components/src/{{ pascalCase name }}.tsx.hbs index 38027c4e6..f912313f6 100644 --- a/plop-templates/components/src/{{ pascalCase name }}.tsx.hbs +++ b/plop-templates/components/src/{{ pascalCase name }}.tsx.hbs @@ -1,7 +1,8 @@ import { forwardRef, type ForwardedRef } from "react"; -import { {{ pascalCase name }}Context } from "./{{ pascalCase name }}Context.ts"; import { useContextProps } from "react-aria-components"; +import { {{ pascalCase name }}Context } from "./{{ pascalCase name }}Context.ts"; + import styles from "./{{ pascalCase name }}.module.css"; export const Global{{ pascalCase name }}CssSelector = "hop-{{ pascalCase name }}"; diff --git a/plop-templates/components/src/{{ pascalCase name }}Context.ts.hbs b/plop-templates/components/src/{{ pascalCase name }}Context.ts.hbs index 6e69521c2..10e503e22 100644 --- a/plop-templates/components/src/{{ pascalCase name }}Context.ts.hbs +++ b/plop-templates/components/src/{{ pascalCase name }}Context.ts.hbs @@ -1,5 +1,6 @@ import { createContext } from "react"; import type { ContextValue } from "react-aria-components"; + import type { {{ pascalCase name }}Props } from "./{{ pascalCase name }}.tsx"; export const {{ pascalCase name }}Context = createContext>({}); diff --git a/plop-templates/components/tests/chromatic/{{ pascalCase name }}.stories.tsx.hbs b/plop-templates/components/tests/chromatic/{{ pascalCase name }}.stories.tsx.hbs index 9aa533aa2..5eb24d2aa 100644 --- a/plop-templates/components/tests/chromatic/{{ pascalCase name }}.stories.tsx.hbs +++ b/plop-templates/components/tests/chromatic/{{ pascalCase name }}.stories.tsx.hbs @@ -1,6 +1,7 @@ -import { {{ pascalCase name }} } from "../../src/{{ pascalCase name }}.tsx"; import type { Meta, StoryObj } from "@storybook/react"; +import { {{ pascalCase name }} } from "../../src/{{ pascalCase name }}.tsx"; + const meta = { title: "Components/{{ pascalCase name }}", component: {{ pascalCase name }} @@ -10,5 +11,5 @@ export default meta; type Story = StoryObj; -export const Default: Story = { -}; +export const Default = { +} satisfies Story; diff --git a/plop-templates/components/tests/jest/{{ pascalCase name }}.ssr.test.tsx.hbs b/plop-templates/components/tests/jest/{{ pascalCase name }}.ssr.test.tsx.hbs index 56c07d61b..aa29610b2 100644 --- a/plop-templates/components/tests/jest/{{ pascalCase name }}.ssr.test.tsx.hbs +++ b/plop-templates/components/tests/jest/{{ pascalCase name }}.ssr.test.tsx.hbs @@ -1,9 +1,10 @@ /** * @jest-environment node */ -import { {{ pascalCase name }} } from "../../src/{{ pascalCase name }}.tsx"; import { renderToString } from "react-dom/server"; +import { {{ pascalCase name }} } from "../../src/{{ pascalCase name }}.tsx"; + describe("{{ pascalCase name }}", () => { it("should render on the server", () => { const renderOnServer = () => diff --git a/plop-templates/components/tests/jest/{{ pascalCase name }}.test.tsx.hbs b/plop-templates/components/tests/jest/{{ pascalCase name }}.test.tsx.hbs index 64663abaf..533e60146 100644 --- a/plop-templates/components/tests/jest/{{ pascalCase name }}.test.tsx.hbs +++ b/plop-templates/components/tests/jest/{{ pascalCase name }}.test.tsx.hbs @@ -1,6 +1,7 @@ +import { render, screen } from "@hopper-ui/test-utils"; + import { {{ pascalCase name }} } from "../../src/{{ pascalCase name }}.tsx"; import { {{ pascalCase name }}Context } from "../../src/{{ pascalCase name }}Context.ts"; -import { render, screen } from "@hopper-ui/test-utils"; describe("{{ pascalCase name }}", () => { it("should render a span with default class", () => {