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

eslint-plugin-simple-import-sort

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-simple-import-sort - npm Package Versions

23

12.1.1

Diff

Changelog

Source

Version 12.1.1 (2024-07-02)

This release adds a short meta.docs.description to each rule. Thanks to fisker Cheung (@fisker)!

lydell
published 12.1.0 •

Changelog

Source

Version 12.1.0 (2024-04-13)

This release adds TypeScript type definitions for the plugin itself. This is useful when you use TypeScript to check your ESLint configuration. It assumes that you install @types/eslint yourself. Thanks to @Logicer16!

lydell
published 12.0.0 •

Changelog

Source

Version 12.0.0 (2024-02-10)

This release removes the support for import assignments added in version 11.0.0:

  • Turns out it was broken in some cases.
  • The suggested fix went past my complexity tolerance for such an esoteric feature.
  • I also learned that they aren’t really imports, and that I don’t understand their semantics well enough to know how sorting them affects your program.

If you miss the support for import assignments, I suggest you write your own ESLint rule which moves them out of the way from the actual imports, sorting them or not.

lydell
published 11.0.0 •

Changelog

Source

Version 11.0.0 (2024-02-08)

This release adds support for TypeScript import assignments (import A = B.C and import A = require("module")). Thanks to Szabolcs Kurdi (@szku01) and Svyatoslav Zaytsev (@MillerSvt)!

It’s only a breaking change if you use TypeScript import assignments, and only in the form that you need to autofix your files.

In other news, this release adds the meta plugin property in preparation for ESLint Flat Config, and avoids the deprecated context.getSourceCode() method (while still being backwards compatible).

lydell
published 10.0.0 •

Changelog

Source

Version 10.0.0 (2023-01-27)

This release might move some imported items with type around. This is a breaking formatting change (that only affects TypeScript and Flow), but only in the form of that you need to autofix your files.

In previous versions, type specifiers came first:

import { type B, a } from "a";
export { type B, a } from "a";

Now, all specifiers are sorted alphabetically, regardless of type:

import { a, type B } from "a";
export { a, type B } from "a";

Motivation:

You might import a class for a type annotation using:

<!-- prettier-ignore -->
import {
  type MyClass,
  coolFunction,
} from "example";

Later, you also start instantiating that class in the same file (new MyClass()), so you remove type.

Previously, this resulted in a messy diff due to the class moving:

 import {
-  type MyClass,
   coolFunction,
+  MyClass,
 } from "example";

Now, the sorting with the type keyword would be:

<!-- prettier-ignore -->
import {
  coolFunction,
  type MyClass,
} from "example";

Now there’s no reordering diff, just the type keyword being removed:

 import {
   coolFunction,
-   type MyClass,
+   MyClass,
 } from "example";

This is consistent with [“Why sort on from?”][sort-from].

Thanks to Jake Bailey (@jakebailey) for reporting and suggesting the fix!

lydell
published 10.0.0-beta.1 •

lydell
published 9.0.0 •

Changelog

Source

Version 9.0.0 (2023-01-16)

This version adds support for [eslint-plugin-svelte], and for declare module in TypeScript.

More generally, imports and exports are now supported anywhere, by finding the set of parents of all imports and exports and working with those. Previously, the plugin only sorted imports and exports directly inside a Program node. For eslint-plugin-svelte and declare module that didn’t cut it.

This is only a breaking change if you imports or exports in declare module in TypeScript, and only in the form of that you need to autofix your files.

lydell
published 9.0.0-beta.1 •

lydell
published 8.0.0 •

Changelog

Source

Version 8.0.0 (2022-09-03)

Node.js builtin modules prefixed with node: are now in a separate group by default (regex: ^node:), above the packages group. (Node.js builtins without node: are still sorted together with npm packages like before.)

Before:

import fs from "fs";
import _ from "lodash-es";
import { rmSync } from "node:fs";

After:

import { rmSync } from "node:fs";

import fs from "fs";
import _ from "lodash-es";

This is only a breaking change if you use the node: prefix in imports, and only in the form of that you need to autofix your files.

lydell
published 7.0.0 •

Changelog

Source

Version 7.0.0 (2020-12-08)

You can now customize where type imports (import type { X } from "x") go, via the groups option. Type imports have \u0000 at the end.

This is only a breaking change if you use the groups option and your regexes care about what the last character is. If so, you now need to account for the fact that the last character of type imports is \u0000.

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