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

Repo: v6 branch regression for adding to JSX.IntrinsicAttributes in typecheck task #7166

Closed
JoshuaKGoldberg opened this issue Jul 6, 2023 · 2 comments · Fixed by #7602
Closed
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working repo maintenance things to do with maintenance of the repo, and not with code/docs

Comments

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Jul 6, 2023

Suggestion

On the v6 branch, we now get typecheck (tsc) complaints in ast-spec's fixture for augmenting JSX.IntrinsicElements:

 ~/repos/typescript-eslint/packages/ast-spec $ yarn typecheck
yarn run v1.22.19
$ tsc -p tsconfig.json --noEmit
src/jsx/JSXNamespacedName/fixtures/component-dashed/fixture.tsx:8:24 - error TS2339: Property 'foo' does not exist on type 'JSX.IntrinsicElements'.

8 const componentBasic = <foo />;
                         ~~~~~~~

src/jsx/JSXNamespacedName/fixtures/component-dashed/fixture.tsx:9:25 - error TS2339: Property 'foo-bar:baz-bam' does not exist on type 'JSX.IntrinsicElements'.

9 const componentDashed = <foo-bar:baz-bam />;
                          ~~~~~~~~~~~~~~~~~~~


Found 2 errors in the same file, starting at: src/jsx/JSXNamespacedName/fixtures/component-dashed/fixture.tsx:8

It happens both for traditional names (e.g. foo) and for TypeScript 5.1's new namespaced names (e.g. 'foo-bar:baz-bam') added in #7088. So I don't think it's specific to TS 5.1's namespace changes.

But... why is this happening? Why is the fixture not allowing augmentation of JSX.IntrinsicElements?

I'm 80% confident this is a silly little mistake I made in merging main -> v6, but can't figure it out... :sob

@JoshuaKGoldberg JoshuaKGoldberg added triage Waiting for maintainers to take a look repo maintenance things to do with maintenance of the repo, and not with code/docs labels Jul 6, 2023
@JoshuaKGoldberg JoshuaKGoldberg added this to the 6.0.0 milestone Jul 6, 2023
@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for maintainers to take a look labels Jul 6, 2023
JoshuaKGoldberg added a commit that referenced this issue Jul 6, 2023
@JoshuaKGoldberg
Copy link
Member Author

I // @ts-expect-error'd the build breakage away, but we should really investigate this. 41d68ea

@JoshuaKGoldberg JoshuaKGoldberg removed this from the 6.0.0 milestone Jul 6, 2023
@JoshuaKGoldberg JoshuaKGoldberg added the bug Something isn't working label Jul 6, 2023
@armano2
Copy link
Member

armano2 commented Sep 5, 2023

@JoshuaKGoldberg currently only ts file extensions are excluded from typechecking

"exclude": ["**/fixtures/**/fixture.ts"],

-  "exclude": ["**/fixtures/**/fixture.ts"],
+  "exclude": ["**/fixtures/**/fixture.ts", "**/fixtures/**/fixture.tsx"],

alternatively you can addmissing declare global

declare namespace JSX {
interface IntrinsicElements {
foo: any;
'foo-bar:baz-bam': any;
}
}

+ declare global {
+ namespace JSX {
- declare namespace JSX {
    interface IntrinsicElements {
      foo: any;
      'foo-bar:baz-bam': any;
    }
  }
+ }

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants