import-sort

  • Version 6.0.0
  • Published
  • 17.1 kB
  • 5 dependencies
  • ISC license

Install

npm i import-sort
yarn add import-sort
pnpm add import-sort

Overview

Sort ES2015 (aka ES6) imports programmatically.

Index

Functions

function applyChanges

applyChanges: (code: string, changes: ICodeChange[]) => string;

    function importSort

    importSort: (
    code: string,
    rawParser: string | IParser,
    rawStyle: string | IStyle,
    file?: string,
    options?: object
    ) => ISortResult;

      function sortImports

      sortImports: (
      code: string,
      parser: IParser,
      style: IStyle,
      file?: string,
      options?: object
      ) => ISortResult;

        Interfaces

        interface ICodeChange

        interface ICodeChange {}

          property code

          code: string;

            property end

            end: number;

              property note

              note?: string;

                property start

                start: number;

                  interface ISortResult

                  interface ISortResult {}

                    property changes

                    changes: ICodeChange[];

                      property code

                      code: string;

                        Package Files (1)

                        Dependencies (5)

                        Dev Dependencies (19)

                        Peer Dependencies (0)

                        No peer dependencies.

                        Badge

                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/import-sort.

                        • Markdown
                          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/import-sort)
                        • HTML
                          <a href="https://www.jsdocs.io/package/import-sort"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>