Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment at beginning of file gets replicated every time #344

Open
1 task
ben221199 opened this issue Feb 1, 2025 · 0 comments
Open
1 task

Comment at beginning of file gets replicated every time #344

ben221199 opened this issue Feb 1, 2025 · 0 comments

Comments

@ben221199
Copy link

Your Environment

  • Prettier version: 3.4.2
  • node version: 22.13.0
  • package manager: [email protected]
  • IDE: PhpStorm

Describe the bug

Whenever I run yarn prettier . --write, the comment at the beginning of the while gets replicated every time. Its replicate will appear UNDER the imports.

To Reproduce

Have the following code:

// Offerte aanvragen
"use client";

import axios from "axios";
import Cookies from "js-cookie";
import { useRouter } from "next/navigation";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { RotatingLines } from "react-loader-spinner";
import { v4 as uuidv4 } from "uuid";
import ClientsTellSmall from "~/components/ClientsTellSmall";
import ErrorMessage from "~/components/ErrorMessage";
import FormSubmittedMessage from "~/components/FormSubmittedMessage";
import Heading from "~/components/Heading";
import LabelCard from "~/components/LabelCard";
import PortableContent from "~/components/PortableContent";

/**
 * OFFER / OFFERTE AANVRAGEN
 */
const RequestQuoteForm = () => {};

Expected behavior

The expected behavior is having // Offerte aanvragen just once in the code.

Screenshots, code sample, etc

Image
Image

Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)

/**@type {import("prettier").Config}*/
const prettierConfig = {
  importOrderSeparation: true,
  importOrderSortSpecifiers: true,
  plugins: ["@trivago/prettier-plugin-sort-imports"],
};

export default prettierConfig;

Error log

N/A

Contribute to @trivago/prettier-plugin-sort-imports

  • I'm willing to fix this bug 🥇
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@ben221199 and others