Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO rules #1

Open
13 tasks
manucorporat opened this issue Jun 17, 2019 · 5 comments
Open
13 tasks

TODO rules #1

manucorporat opened this issue Jun 17, 2019 · 5 comments
Labels
Good First Issue Good for newcomers Help Wanted Extra attention is needed

Comments

@manucorporat
Copy link
Contributor

manucorporat commented Jun 17, 2019

Pending rules:

  • public apis must be documented
  • order of properties/methods following the stencil’s style guide https://stenciljs.com/docs/style-guide
  • validation of the component’s tag
  • validation of the component’s class name
  • enforce tag-name prefix
  • ban certain tag-name prefixes (like stencil-, stncl-, sc-...) configurable
  • @Element() 's type must be HTML{tag-name}Element
  • mutation of Prop()
  • side mutation of objects and arrays in @State() and @Prop()
  • prefer <Host> vs returning array in render()
  • always prefer <Host>
  • reusage or JSX nodes (not possible in stencil's render)
  • @Watch decorators listens to existing prop or state

Naming:

  • Consistent naming of Props / Events and method

Code quality

  • Too many methods?
@manucorporat
Copy link
Contributor Author

Help wanted!

@manucorporat manucorporat added Help Wanted Extra attention is needed Good First Issue Good for newcomers labels Jun 17, 2019
@Serabe
Copy link

Serabe commented Jun 17, 2019

For arrays, we can suggest using ReadonlyArray<T> instead of T[] and for objects we have the mapped type Readonly<T>. That way, the checker can be simplified.

@manucorporat
Copy link
Contributor Author

That's a great idea @Serabe ! and easy enough to implement

@chimon2000
Copy link

@manucorporat would it be better to split these rules out to individual issues? I see some have been added but the list hasn't been updated.

@d0whc3r
Copy link
Contributor

d0whc3r commented Sep 14, 2019

I just created a pull request with some rules and tests
#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Good for newcomers Help Wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants