Open
Description
(This pertains to CRA w/ the --typescript flag
.)
Putting a loose d.ts file at the top level of src adds clutter and breaks the convention of putting all d.ts files together in a folder, such as "types".
Suggestions to remedy this (in order of preference):
- Honor the new location of react-app-env.d.ts if we move it.
- Allow us to configure where this file goes.
- Place the file in src/types.
EDIT:
@nhooyr Given its confusing, you could also add a comment to the generated file explaining why its there.
@bugzpodder This file was created to include create-react-app specific types. Removing it will cause errors like:
TypeScript error in ~/src/App.tsx(2,18):
Cannot find module './logo.svg'. TS2307
1 | import React from 'react';
> 2 | import logo from './logo.svg';
| ^
3 | import './App.css';
4 |
5 | const App: React.FC = () => {
This was created from #5611 if you want more details.