Skip to content

Commit

Permalink
Fix: Updated the plop templates to follow linting rules (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
vicky-comeau authored Apr 19, 2024
2 parents 0ed7f28 + 09abf46 commit 51e0c92
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -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
*
Expand All @@ -27,5 +28,5 @@ type Story = StoryObj<typeof meta>;
/**
* TODO: Add description
*/
export const Default: Story = {
};
export const Default = {
} satisfies Story;
3 changes: 2 additions & 1 deletion plop-templates/components/src/{{ pascalCase name }}.tsx.hbs
Original file line number Diff line number Diff line change
@@ -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 }}";
Expand Down
Original file line number Diff line number Diff line change
@@ -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<ContextValue<{{ pascalCase name }}Props, any>>({});
Expand Down
Original file line number Diff line number Diff line change
@@ -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 }}
Expand All @@ -10,5 +11,5 @@ export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
};
export const Default = {
} satisfies Story;
Original file line number Diff line number Diff line change
@@ -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 = () =>
Expand Down
Original file line number Diff line number Diff line change
@@ -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", () => {
Expand Down

0 comments on commit 51e0c92

Please sign in to comment.