DEV Community

loading...

Typescript interface file name conventions

davidarmendariz profile image David Armendáriz ・1 min read

Ok, so I have read out there that we shouldn't use the prefix I in our interfaces. I like the prefix I for my interfaces, but I can avoid using it if it is a "best practice". But what about file names? If you have a Foobar interface, what should be the name of the file? foobar.ts? foobar-interface.ts?

Discussion (2)

pic
Editor guide
Collapse
stojakovic99 profile image
Nikola Stojaković

I typically put interfaces in an interfaces directory to make their function more obvious. You can also use Angular style naming (foobar.interface.ts).

Collapse
carlosaabud profile image
Carlos

foobar.model.ts

That’s usually what I see..