1.0.8 • Published 3 years ago

import-sort-style-regex v1.0.8

Weekly downloads
21
License
MIT
Repository
github
Last release
3 years ago

import-sort-style-regex

Customizable style for import-sort using Regular Expressions.

Get started

Installation

This works best with prettier-plugin-import-sort installed.

npm install --save-dev import-sort-style-regex

Customization Example

The following added to package.json is an example of sorting by regex groups in Typescript. Each array in options.groups can contain multiple regex patterns which will appear in order. Each group is separated by an empty line.

"importSort": {
  ".js, .jsx, .ts, .tsx": {
    "parser": "typescript",
    "style": "regex",
    "options": {
      "groups": [
        [
          "^react"
        ],
        [
          "^@\\w",
          "^\\w"
        ],
        [
          "^\\.\\./",
          "^\\./"
        ],
        [
          "\\.s?css$"
        ]
      ]
    }
  }
}
1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago