Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ianvs/prettier-plugin-sort-imports

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ianvs/prettier-plugin-sort-imports - npm Package Compare versions

Comparing version 3.5.0 to 3.5.1

13

lib/src/utils/merge-nodes-with-matching-flavors.js

@@ -47,3 +47,9 @@ "use strict";

}
/** e.g. import Default from "someModule" */
/**
* Default type or value import
*
* e.g.
* import Default from "someModule"
* import type Default from "someModule"
*/
function nodeIsImportDefaultSpecifier(node) {

@@ -85,2 +91,7 @@ return node.type === 'ImportDefaultSpecifier';

}
if (nodeToKeep.importKind === 'type' && nodeToKeep.specifiers.some(nodeIsImportDefaultSpecifier) ||
nodeToForget.importKind === 'type' && nodeToForget.specifiers.some(nodeIsImportDefaultSpecifier)) {
// Cannot merge default type imports (.e.g. import type React from 'react')
return false;
}
return true;

@@ -87,0 +98,0 @@ }

2

package.json
{
"name": "@ianvs/prettier-plugin-sort-imports",
"private": false,
"version": "3.5.0",
"version": "3.5.1",
"description": "A prettier plugins to sort imports in provided RegEx order",

@@ -6,0 +6,0 @@ "main": "lib/src/index.js",

@@ -231,4 +231,14 @@ # Prettier plugin sort imports <!-- omit in toc -->

A boolean value to enable or disable sorting of the specifiers in an import declarations.
A boolean value to enable or disable sorting of the specifiers in an import declarations. If enabled, type imports will be sorted after value imports.
Before:
```ts
import Default, {type Bravo, delta as echo, charlie, type Alpha} from 'source';
```
After:
```ts
import Default, {charlie, delta as echo, type Alpha, type Bravo} from 'source';
```
#### `importOrderGroupNamespaceSpecifiers`

@@ -235,0 +245,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc