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

fix: "Unused '@ts-expect-error' directive" compilation error #54

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

svallory
Copy link
Contributor

Version 0.7.3 of tags-api-preview introduced a bug with the change to <get> adding support for return type parameter :/

The @ts-expect-error in the code here breaks compilation of projects using tags preview when their tsconfig has compilerOptions.noUnusedParameters set to false. Example:

node_modules/@marko/tags-api-preview/dist/components/get/index.d.marko:1:1 - error TS2578

> 1 | // @ts-expect-error 'VariableType' is declared but its value is never read. (It is only used to set the type of the return
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unused '@ts-expect-error' directive.
  2 | export interface Input<VariableType = unknown> {
  3 |   value: string;
  4 | }

The only reliable approach here is to use @ts-ignore so compilation succeeds regardless of the noUnusedParameters value

Copy link

changeset-bot bot commented Mar 11, 2024

🦋 Changeset detected

Latest commit: b251986

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@marko/tags-api-preview Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.50%. Comparing base (4c3b67c) to head (b251986).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #54   +/-   ##
=======================================
  Coverage   77.50%   77.50%           
=======================================
  Files          63       63           
  Lines        1307     1307           
  Branches      341      341           
=======================================
  Hits         1013     1013           
  Misses        259      259           
  Partials       35       35           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DylanPiercey DylanPiercey merged commit fd6ba01 into marko-js:main Mar 11, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants