Installation Import Sorter pour Dart

VérifiéPrudence

Installe l'outil import_sorter pour les projets Dart afin de trier automatiquement les imports. Utile lorsque vous devez organiser les imports Dart, en particulier dans les configurations monorepo avec pub workspaces. La commande installe depuis une branche Git spécifique qui prend en charge les workspaces.

Spar Skills Guide Bot
DeveloppementDébutant
5002/06/2026
Claude CodeCursorWindsurf
#dart#import-sorter#monorepo#code-formatting

Recommandé pour

Notre avis

Installe et configure import_sorter pour trier automatiquement les imports Dart, avec une prise en charge des monorepos utilisant pub workspaces.

Points forts

  • Installation rapide depuis une branche de correction
  • Support natif des espaces de travail pub
  • Commande simple via dart pub global run

Limites

  • Nécessite Dart SDK installé
  • Dépend d'une branche GitHub non officielle pour le support monorepo
Quand l'utiliser

Quand vous avez besoin de trier les imports dans des fichiers Dart, surtout dans un projet monorepo avec pub workspaces.

Quand l'éviter

Si vous utilisez un autre formateur d'imports comme dartfmt intégré ou un IDE qui gère déjà le tri.

Analyse de sécurité

Prudence
Score qualité80/100

The skill instructs the agent to run 'dart pub global activate' from a GitHub repository, which downloads and executes code. While the tool is legitimate, the source is not audited, and the skill provides no assurance of the repository's trustworthiness. This introduces moderate risk of executing malicious code.

Points d'attention
  • Installs a Dart package from an external Git repository without verifying its integrity or authenticity.
  • No checksum or signature validation is performed, posing a supply chain risk.

Exemples

Install import_sorter
Install import_sorter for sorting Dart imports in my monorepo project.
Sort imports in a file
Sort the imports in my Dart file using import_sorter.
Setup import sorter for monorepo
I need to set up import_sorter with support for pub workspaces.

name: init-import-sorter description: Install import_sorter for Dart import sorting. Use when user needs import sorting, wants to sort imports, or gets "import_sorter not found". Triggers on "install import_sorter", "init import sorter", "sort imports", "setup import_sorter".

安装 Import Sorter

确保 import_sorter 已安装并可用。使用支持 pub workspaces 的修复版本。

安装步骤

# 1. 检查是否已安装
dart pub global list | grep import_sorter

# 2. 如果未安装,从修复分支安装(支持 monorepo pub workspaces)
dart pub global activate --source git https://github.com/myConsciousness/import_sorter.git --git-ref fix/monorepo-pub-workspaces

使用

# 对单个文件排序
dart pub global run import_sorter --no-comments

# 通过 melos 对所有包排序
melos sort
Skills similaires