1.0.8 • Published 5 years ago
import-sort-style-regex v1.0.8
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-regexCustomization 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$"
]
]
}
}
}