Coding suggestions #685
Mister-Hope
started this conversation in
General
Replies: 1 comment
-
I got it! It is very helpful! I will improve one by one. ❤️ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's not a good habit to renamed default export.
E.g.:
Artalk/ui/packages/artalk/src/artalk.ts
Line 5 in 763fbc4
There is actually no need to rename Context class
Artalk/ui/packages/artalk/src/lib/user.ts
Line 55 in 763fbc4
While all imports are
import User from './user'
and the file has aUser
classAnother case is:
Artalk/ui/packages/artalk/src/plugins/markdown.ts
Lines 1 to 10 in 763fbc4
Artalk/ui/packages/artalk/src/comment/comment.ts
Line 171 in 763fbc4
Marked is a standard library, while the same variable is used on a local edit of the standard marked.
Contributors will be confused about API like this and likely to make mistakes by writing library api when contributing.
The above things will greatly confuse others when understanding symbols in the project.
To solve the first one, import the default export with the exact name, for the second one, you'd better use names like
myMarked
ormarkdownParser
Beta Was this translation helpful? Give feedback.
All reactions