Next.js: with-typescript-eslint-jest creates pages/api/hello.tsx

Created on 7 Sep 2020  路  4Comments  路  Source: vercel/next.js

Bug report

with-typescript-eslint-jest creates pages/api/hello.tsx instead of pages/api/hello.ts

To Reproduce

  1. npx create-next-app --example with-typescript-eslint-jest with-typescript-eslint-jest-app
  2. page/api/ has hello.tsx instead of hello.ts

Expected behavior

Expected a .ts file and not a .tsx file for API.

Screenshots

N/A

System information

  • OS: Ubuntu 20.04
  • Browser: N/A
  • Version of Next.js: 9.5.3
  • Version of Node.js: 14.9.0

Additional context

This is easy for me to fix. For new or less experienced users this might be confusing and misleading.

good first issue story

Most helpful comment

Hi, can i take this one? :)

All 4 comments

Both are fine really, but feel free to send a PR.

I agree that both will work. I think that the extension, in this context, conveys intent.

I would expect .tsx to render and have React markup and .ts not to have it.

Perhaps this could be tagged as good-first-issue?

Hi, can i take this one? :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timneutkens picture timneutkens  路  72Comments

robinvdvleuten picture robinvdvleuten  路  74Comments

baldurh picture baldurh  路  74Comments

rauchg picture rauchg  路  208Comments

matthewmueller picture matthewmueller  路  102Comments