Add lint rule enforcing type imports in a separate block before other imports
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- tooling
Rechercherichtung
Lies src/components/build-common/eslint.config.mjs und prüfe die bestehende importbezogene Konfiguration sowie das Lint-Setup des Pakets. Ermittle, wie die gemeinsame Regel src/Standalone und src/components abdecken soll, einschließlich Testdateien und generierter *Resources.ts-Dateien. Als abgeschlossen gilt die Aufgabe, wenn die Regel aktiviert ist, bestehende Verstöße behoben oder als absichtliche Unterdrückungen dokumentiert sind und CI neue Verstöße ablehnt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
Type imports are inconsistently placed throughout the codebase. In some files they are interleaved with value imports; in others they appear below them. There is currently no automated enforcement, so the convention is only applied when a reviewer happens to notice it.
This surfaced during review of !777789 - Fix SDK job type imports in blob/table extensions, where the reviewer asked for type imports to be moved into a separate block above other imports. Investigation showed the placement in question was pre-existing on main, not introduced by that PR -- the change only renamed identifiers on those lines. That makes it a codebase-wide convention gap rather than a defect in any single change, and it means the same review comment will keep recurring on unrelated PRs until it is enforced automatically.
Proposal
Add an ESLint rule to src/components/build-common/eslint.config.mjs enforcing that:
- Type-only imports are grouped into their own contiguous block.
- That block appears before all value imports.
Likely implementation, to be confirmed by whoever picks this up:
@typescript-eslint/consistent-type-importsto ensure type-only imports actually useimport typesyntax, so they are statically distinguishable.import/order(or the equivalent already in use) with an explicittypegroup ordered first, to enforce block placement and separation.
Considerations
- Fleet-wide churn. Enabling this with autofix will touch a large number of files across
src/Standaloneand every package undersrc/components. The rollout should be a dedicated PR separate from any feature or bugfix work, so the diff stays reviewable and does not collide with in-flight branches. - Sequencing. Several component PRs are in flight right now. This should land during a quiet window, or be staged per-package, to avoid manufacturing merge conflicts across active branches.
- Version bumps. Any
src/components/*package touched by the autofix requires a version bump per repo rules. If the rollout is staged per-package, each stage carries its own bump. - Confirm whether the rule should apply to test files and to generated files. Generated
*Resources.tsfiles undersrc/Standalone/app/resources/are rewritten by the gulp resource generator on every build, so any lint fix applied to them would be reverted on the next build. Those should almost certainly be excluded, or the generator template updated instead.
Acceptance criteria
- Lint rule is enabled in the shared ESLint config.
- Existing violations are fixed, or explicitly and deliberately suppressed with a documented rationale.
- CI fails on new violations.
- Vorherrschende Sprache
- Keine Sprachdaten
- Sterne
- 458
- Forks
- 92
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/AzureStorageExplorer
-
Schwierigkeit 2/5 1-2 Tage Anfängerfreundlichkeit 76/100
microsoft/AzureStorageExplorer#9186 ·
-
:globe_with_meridians: hard-coded string :globe_with_meridians: localization :test_tube: testing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
microsoft/AzureStorageExplorer#9152 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 58/100
microsoft/AzureStorageExplorer#9219 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 65/100
microsoft/AzureStorageExplorer#9218 · 8 Reaktionen ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 57/100
microsoft/AzureStorageExplorer#9217 ·
Alle Issues in microsoft/AzureStorageExplorer
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
project-codeflare/codeflare-sdk#1195 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement nav-pilot
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
NanmiCoder/dsh-agent-teams#326 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
primer/stylelint-config#782 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
obsidian-nvim/obsidian.nvim#1015 ·
Maintainer antworten meist innerhalb von 1 Tag