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

Behavior Change: All comments before firstImport are treated as top-of-file #82

Merged
merged 13 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,22 @@ exports[`import-comments-document-top-all-are-untouched.ts - typescript-verify >
* This comment is before the first import, and so should never be moved.
* https://github.com/IanVS/prettier-plugin-sort-imports/issues/81
*/

// second comment
import type { A } from 'a'; // a
import { b } from 'b';
import type { A } from 'a';
import { a } from 'a';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* @prettier
* This comment is before the first import, and so should never be moved.
* https://github.com/IanVS/prettier-plugin-sort-imports/issues/81
*/

// second comment

fbartho marked this conversation as resolved.
Show resolved Hide resolved
import { a, type A } from "a";
// a
import { b } from "b";

`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* This comment is before the first import, and so should never be moved.
* https://github.com/IanVS/prettier-plugin-sort-imports/issues/81
*/

// second comment
import type { A } from 'a'; // a
import { b } from 'b';
import type { A } from 'a';
import { a } from 'a';