Skip to content

Investigate CSS and HTML module support in noImportCycles #11218

Description

@coderabbitai

Summary

Investigate whether the noImportCycles lint rule should evaluate CSS and HTML modules, in addition to JavaScript modules.

The current SCC optimisation in PR #11154 indexes JavaScript modules. This may be correct if noImportCycles only operates on JavaScript import edges. Confirm the rule's intended module scope before extending the SCC query or changing the rule.

Required investigation

  • Document which module kinds and import edges noImportCycles currently evaluates.
  • Determine whether CSS modules and HTML modules can participate in import cycles that the rule should report.
  • Decide whether the rule should remain JavaScript-only or support additional module kinds.
  • If additional module kinds are in scope, propose the required changes to module-graph queries, SCC computation, diagnostics, and tests.

Affected areas

  • crates/biome_js_analyze/src/lint/suspicious/no_import_cycles.rs
  • crates/biome_module_graph/src/db/queries/js_scc.rs
  • Module graph handling for CSS and HTML imports

Acceptance criteria

  • The supported module kinds for noImportCycles are documented.
  • The project records a decision for CSS and HTML modules.
  • If support is required, a follow-up implementation plan includes regression and query-correctness tests.

Requested by @dyc3.

Related pull request: #11154
Related review discussion: #11154 (comment)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions