import-sort-parser-typescript is a specialized parser module designed for the import-sort ecosystem, specifically to handle TypeScript and TSX files. It leverages the native TypeScript compiler for syntax parsing, enabling import sorting based on the TypeScript language rules. As a component, it is typically used in conjunction with `import-sort`, `import-sort-config`, and a chosen sorting style. The package is currently at version 6.0.0, but was last published approximately 7 years ago, suggesting a maintenance or possibly abandoned status rather than active development. Its primary differentiation lies in using the TypeScript parser directly, which historically provided accurate parsing for TypeScript-specific constructs, but its age raises concerns about compatibility with recent TypeScript versions and features. Release cadence is effectively halted given its last update.
npm install import-sort-parser-typescriptVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to integrate `import-sort-parser-typescript` into a project's `package.json` for automatic import sorting with the `import-sort` CLI tool. It sets up the necessary dependencies and configures `import-sort` to use the 'typescript' parser for .ts and .tsx files.
Consider migrating to a more actively maintained import sorting solution that natively supports recent TypeScript versions, such as `@trivago/prettier-plugin-sort-imports`, `eslint-plugin-simple-import-sort`, or configuring ESLint's `sort-imports` rule with `@typescript-eslint/parser`.
Ensure you have `import-sort` and a runner (like `import-sort-cli`) installed and configured your `package.json` or `.importsortrc.json` to use `"parser": "typescript"` for your TypeScript files.
Explore native VS Code features ('Organize Imports'), Prettier plugins (e.g., `@trivago/prettier-plugin-sort-imports`), or ESLint rules (`sort-imports` with `@typescript-eslint/parser`) for potentially more robust and actively maintained import sorting solutions.Downgrade your TypeScript version (not recommended) or, preferably, switch to a more modern import sorting tool or plugin that is actively maintained and supports your current TypeScript version. Refer to the warnings for alternatives.
In your `importSort` configuration (e.g., in `package.json` or `.importsortrc.json`), ensure the parser is specified as `"parser": "typescript"` (the alias) and not `"parser": "import-sort-parser-typescript"`.