ueno-llc / react-native-starter

Professional react-native starter kit with everything you'll ever need to deploy rock solid apps
https://ueno-llc.github.io/react-native-starter
MIT License
574 stars 90 forks source link

[WIP] [discussion] TSLinting improvements #188

Closed birkir closed 5 years ago

birkir commented 6 years ago

Component Imports

One recommendation is to never use default exports, this would mean our index pointer files would have to be something like export { Button } from './Button' - We could skip them all together and just import them directly like import { Button } from '~components/button/Button or stick with the index files and do import { Button } from~components/button`.

Pro: faster Con: maintainance, readability

Aliases

What do we think about aliases, should alias certein folders with the ~ (I found out the @ symbol is restricted). This would mean we would have to update our tsconfig and tslint files respectively when adding more root folders.

Pro: faster Con: maintainance

Typedefs

To much? I added call-signature, parameter and member-variable-declaration.

Pro: autocomplete, editor intelligence, type safety. Con: maintainance, slow

jeremybarbet commented 6 years ago

Component Imports

How faster it would change on our apps we are doing? Would it be much faster? Is the time we gain here, we wouldn't lose it by finding components folder and parents?

Aliases

It looks quite nice to me!

Typedefs

Looks a bit too much, and as the project will grows, it will get more warnings everywhere, I guess :/

jeremybarbet commented 6 years ago

What about renaming the directory store to stores?

birkir commented 6 years ago

Okay very good, minor conflicts, still a lot of work to do, to streamline this.

Let's focus on a React Native only ruleset for now, and then think about react-dom projects later.

jeremybarbet commented 6 years ago

100% agree, let's see first if it fits well on Typescript RN.

It looks good for everything. I'm still not sure for components imports/default import. How do we want to decide between the maintenance/readability side and the faster side

jeremybarbet commented 6 years ago

I did run this branch, but I didn't get any errors for the imports blanks lines, neither on vscode or command line, did you also have this behavior?

birkir commented 5 years ago

Worked for me 🤔