react-native-svg-transformer icon indicating copy to clipboard operation
react-native-svg-transformer copied to clipboard

Docs: why shall we not put the declarations.d.ts on the project root folder

Open soullivaneuh opened this issue 3 years ago • 1 comments

This issue is a documentation details request.

On the Using TypeScript section of the readme, it says about the declarations.d.ts file:

create one if you don't have one already, but don't put in the root folder of your project

The question is: Why should I not?

We don't have any explanation neither source of the reason, and we didn't find anything on the Internet.

Also, we tried to put the declarations.d.ts file on the root folder of our Expo project and it works fine without visible side effect.

May you please provide some references about that?

Thanks!

soullivaneuh avatar Jul 07 '22 16:07 soullivaneuh

I don't know the exact reason, it was added here: https://github.com/kristerkari/react-native-svg-transformer/pull/109

kristerkari avatar Jul 11 '22 08:07 kristerkari

Agree, this is quite a strange comment

austingayler avatar Aug 22 '22 08:08 austingayler

@kristerkari Well, apparently this come from https://github.com/kristerkari/react-native-svg-transformer/issues/6#issuecomment-705549123

But we don't have any explanation of how this fix the original issue and where we should put it instead.

In my opinion, this shouldn't have been merged without strong explanation.

Also, as said before, I tested with this file on the root project, everything works as expected. Maybe an old and resolved Expo bug?

I suggest to revert this documentation change that provide nothing more than confusion.

cc @christophby, may you please add your input on that? Thanks!

soullivaneuh avatar Aug 23 '22 09:08 soullivaneuh

Good question. Tbh I don't remember the reason for this, sorry. Maybe it was just a hickup with the TypeScript version back then. So if you don't see any issues adding the file to the root, feel free to do so :)

christophby avatar Aug 23 '22 09:08 christophby

Alright, let's just fix the documentation not to mention it.

kristerkari avatar Aug 23 '22 09:08 kristerkari

Could someone please review: https://github.com/kristerkari/react-native-svg-transformer/pull/206

kristerkari avatar Aug 23 '22 09:08 kristerkari