Add lint rule enforcing type imports in a separate block before other imports
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- tooling
调研方向
阅读 src/components/build-common/eslint.config.mjs,检查现有的 import 相关配置和 package lint 设置。确定共享规则应如何覆盖 src/Standalone 和 src/components,包括测试文件和生成的 *Resources.ts 文件。规则已启用、现有违规已修复或记录为有意的抑制,并且 CI 会拒绝新的违规时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- 没有语言数据
- 星标
- 458
- 派生
- 92
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/AzureStorageExplorer 的其他 Issue
-
难度 2/5 1-2 天 新手友好度 76/100
microsoft/AzureStorageExplorer#9186 ·
-
:globe_with_meridians: hard-coded string :globe_with_meridians: localization :test_tube: testing
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/AzureStorageExplorer#9152 ·
-
难度 2/5 1-3 小时 新手友好度 58/100
microsoft/AzureStorageExplorer#9219 ·
-
难度 3/5 1-2 天 新手友好度 65/100
microsoft/AzureStorageExplorer#9218 · 8 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 57/100
microsoft/AzureStorageExplorer#9217 ·
查看 microsoft/AzureStorageExplorer 的全部 Issue
相似的 Issue
-
namespace operations
难度 1/5 1 小时以内 新手友好度 65/100
EclipseFdn/open-vsx.org#15057 ·
维护者通常 1 天内回复
-
docs(prompts): IF BLOCKED workflow-scope branch says to comment on the issue on jira/local trackers未关闭agent-butler-finding bug
难度 2/5 1-3 小时 新手友好度 77/100
jordansmall/spindrift#6238 ·
维护者通常 1 天内回复
-
build
难度 1/5 1 小时以内 新手友好度 85/100
MetricsHub/metricshub-community#1472 ·
维护者通常 1 天内回复
-
curriculum documentation quality
难度 2/5 1-3 小时 新手友好度 85/100
githubnext/gh-aw-workshop#5184 ·
维护者通常 1 天内回复
-
chore: package-lock.json drifted — npm ci fails on @posthog/core 1.61.2 vs 1.62.0 (cold install)可能已有人在做 @spudly 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复