Skip to content

Allow sort-imports-ignore to be on other lines #382

@puchm

Description

@puchm

Is your feature request related to a problem?
Currently, the // sort-imports-ignore comment has to be on line 1. This conflicts in situations where you have a shebang at the start of the file. Both can't be on the same line. I.e. the following code causes an error.

#!/usr/bin/env tsx 
// sort-imports-ignore
import "./side-effect";
import { writeFileSync } from "node:fs";

Describe the solution you'd like
Allow the comment to be on any line before imports.

Describe alternatives you've considered
It is of course possible to structure code in a way that makes sure the two lines can be in separate files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions