Skip to content

[linter] Misleading runtime preload recommendation when using ESM #1256

@schlessera

Description

@schlessera

The linter currently doesn't use a separate recommendation for ESM preloads:

: this.warn('<link href=https://cdn.ampproject.org/v0.js rel=preload> is missing');

This is misleading, and might even lead to frustration if users blindly apply the recommendation and it doesn't solve the issue.

The linter should properly differentiate between:

  1. .js with rel=preload
  2. .mjs with rel=preload
  3. .mjs with rel=modulepreload

The recommendation should then be generated accordingly so that applying the recommendation verbatim will actually fix the shown issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions