Registry / testing / import-sort-style-segment

import-sort-style-segment

JSON →
library1.1.0jsnpmunverified

A style configuration for the import-sort Prettier plugin, enforcing Segment's convention: third-party imports first, then absolute, followed by relative, with React always on top. Version 1.1.0 is stable but no longer actively maintained; releases are infrequent. This package is part of the legacy import-sort ecosystem (deprecated in favor of @ianvs/prettier-plugin-sort-imports). It provides a single predefined style function, not a plugin itself, so developers must also install import-sort-style-eslint or similar.

npm install import-sort-style-segment
INSTALL
IMPORT
SIG · IMPORT-SORT-STYLE-
I
import-sort-style-segment
testingjavascriptv1.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

segmentStyle
import segmentStyle from 'import-sort-style-segment'
const segmentStyle = require('import-sort-style-segment')
Default export only; works in both CJS and ESM environments
import-sort-style-segment (named import attempt)
import segmentStyle from 'import-sort-style-segment'
import { segmentStyle } from 'import-sort-style-segment'
Named import does not exist; always use default import
style (in .importsortrc)
{ "style": "segment", "parser": "typescript", "options": {} }
{ "style": "import-sort-style-segment", "parser": "typescript" }
In configuration files, use the short name 'segment' (the style package suffix after 'import-sort-style-'), not the full package name

Configures import-sort to use Segment's style and run it on TypeScript files.

// .importsortrc { "style": "segment", "parser": "typescript", "options": {} } // Then run: import-sort --write 'src/**/*.{ts,tsx}'
Debug
Known issues
deprecatedThis package is part of the deprecated import-sort ecosystem. The import-sort project has been superseded by @ianvs/prettier-plugin-sort-imports.
fix
Migrate to @ianvs/prettier-plugin-sort-imports with the '@ianvs/segment' import order.
affects: >=0.0.0
gotchaThe style name in configuration is 'segment' not the full package name 'import-sort-style-segment'.
fix
Set style to "segment" in .importsortrc.
affects: >=0.0.0
gotchaThis package only provides a style function; you must also install import-sort and optionally import-sort-style-eslint for ESLint integration.
fix
Install import-sort as a devDependency and configure your toolchain accordingly.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'import-sort-style-segment'
The package is not installed, or the import path is incorrect.
fix
Run 'npm install import-sort-style-segment --save-dev' and ensure no typos in import statements.
Invalid style: must be a string or a function
Using a full package name (e.g., 'import-sort-style-segment') instead of the short style name 'segment' in configuration.
fix
Change the style value to 'segment' in .importsortrc.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
import-sortrequiredpeer dependency; this package provides a style function consumed by import-sort
Agent activity
10 hits · last 30 days
node
8
Resources
import-sort-style-segment — npm install import-sort-style-segment · libregistry