{"id":20131,"library":"import-sort-style-segment","title":"import-sort-style-segment","description":"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.","status":"maintenance","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/segmentio/import-sort-style-segment","tags":["javascript"],"install":[{"cmd":"npm install import-sort-style-segment","lang":"bash","label":"npm"},{"cmd":"yarn add import-sort-style-segment","lang":"bash","label":"yarn"},{"cmd":"pnpm add import-sort-style-segment","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; this package provides a style function consumed by import-sort","package":"import-sort","optional":false}],"imports":[{"note":"Default export only; works in both CJS and ESM environments","wrong":"const segmentStyle = require('import-sort-style-segment')","symbol":"segmentStyle","correct":"import segmentStyle from 'import-sort-style-segment'"},{"note":"Named import does not exist; always use default import","wrong":"import { segmentStyle } from 'import-sort-style-segment'","symbol":"import-sort-style-segment (named import attempt)","correct":"import segmentStyle from 'import-sort-style-segment'"},{"note":"In configuration files, use the short name 'segment' (the style package suffix after 'import-sort-style-'), not the full package name","wrong":"{\n  \"style\": \"import-sort-style-segment\",\n  \"parser\": \"typescript\"\n}","symbol":"style (in .importsortrc)","correct":"{\n  \"style\": \"segment\",\n  \"parser\": \"typescript\",\n  \"options\": {}\n}"}],"quickstart":{"code":"// .importsortrc\n{\n  \"style\": \"segment\",\n  \"parser\": \"typescript\",\n  \"options\": {}\n}\n\n// Then run: import-sort --write 'src/**/*.{ts,tsx}'","lang":"typescript","description":"Configures import-sort to use Segment's style and run it on TypeScript files."},"warnings":[{"fix":"Migrate to @ianvs/prettier-plugin-sort-imports with the '@ianvs/segment' import order.","message":"This package is part of the deprecated import-sort ecosystem. The import-sort project has been superseded by @ianvs/prettier-plugin-sort-imports.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Set style to \"segment\" in .importsortrc.","message":"The style name in configuration is 'segment' not the full package name 'import-sort-style-segment'.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Install import-sort as a devDependency and configure your toolchain accordingly.","message":"This package only provides a style function; you must also install import-sort and optionally import-sort-style-eslint for ESLint integration.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install import-sort-style-segment --save-dev' and ensure no typos in import statements.","cause":"The package is not installed, or the import path is incorrect.","error":"Cannot find module 'import-sort-style-segment'"},{"fix":"Change the style value to 'segment' in .importsortrc.","cause":"Using a full package name (e.g., 'import-sort-style-segment') instead of the short style name 'segment' in configuration.","error":"Invalid style: must be a string or a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}