IanVS / prettier-plugin-sort-imports

An opinionated but flexible prettier plugin to sort import statements
Apache License 2.0
892 stars 21 forks source link

'use client' is a separate line, it would be good to have it with node_modules import #144

Closed ivanafanasyeu closed 5 months ago

ivanafanasyeu commented 5 months ago

Is your feature request related to a problem?

'use client';

import { useParams } from 'next/navigation';

Describe the solution you'd like

'use client';
import { useParams } from 'next/navigation';

Describe alternatives you've considered no alternatives, it would be good to add it somehow into regexp groups or something

Additional context It's a feature from new react

IanVS commented 5 months ago

Hello,

Thanks for the suggestion. As I'm sure you know, prettier itself is very opinionated about the formatting it does, and while this plugin does have a number of options, we also are opinionated about some styling decisions. This is one case where we have decided there should be an empty line after directives, to separate them from imports. So we won't be adding an option to adjust this behavior.