Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
schlessera opened this issue Jul 14, 2021 · 1 comment
Open

Comments

@schlessera
Copy link
Collaborator

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.

@schlessera
Copy link
Collaborator Author

The linter should recognize both 2. and 3. but only recommend one of the two, obviously. I think to remember that there was currently a transitional period that favored one over the other, so I'm unsure what the final verdict is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant