-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b889184
commit 06b4230
Showing
8 changed files
with
2,252 additions
and
3,188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Coding Guidelines | ||
|
||
We follow strict set of coding guidelines and use linter to make sure no mistake is done. We have inherited our coding guidelines fom google es6 guidelines. | ||
|
||
## Naming | ||
|
||
* Class Name must be in PascalCase. | ||
* Class public or protect member should be in camelCase. | ||
* Class private member should be in camelCase having '_' in the end. | ||
* A file name should be in snake case. | ||
|
||
## Static Member | ||
|
||
A static function or variable should not be used directly instead it should be wrap in a private function with get and set. | ||
|
||
e.g - | ||
``` | ||
class Util{ | ||
static multiply(num1:number, num2:number){ | ||
return num*num2 | ||
} | ||
} | ||
``` | ||
now in order to use in another class | ||
|
||
``` | ||
class Main{ | ||
private multiply_(num1:number, num2:number){ | ||
return Util.multiply(num1,num2); | ||
} | ||
} | ||
``` | ||
|
||
## TypeScript guidelines | ||
|
||
* Every variable should be staticly typed . If it may accept multiple type then add multiple type or any. Though any is not recommended until and unless there is hard requirement. | ||
|
||
## CodeThink Approach | ||
|
||
* A class name should clearly explain its behaviour. | ||
* Always intialize and assign member variable in constructor method. | ||
* If there are multiple files which are realted to each other then keep them in a single folder create a es6 mopdule by exporting all of them in a common file index.ts. | ||
* Do not create any global variable instead create a class and add the variable as static. | ||
* Remove something if its not being used. Do not comment and keep it for the future reference. | ||
* Always use arrowType function. | ||
* Always use es6 advanced inbult functions like - findIndex, find etc. If you are using something old js style that is no problem but if you found later on that this can be replaced with es6 then please replace it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Contributing | ||
|
||
From opening a bug report to creating a pull request: every contribution is appreciated and welcome. If you're planning to implement a new feature or change the api - please create an issue first. This way we can ensure that your precious work is not in vain. | ||
|
||
Thing that should not be change - | ||
|
||
1. package.json | ||
2. ignore files like - gitignore, npmignore | ||
3. travis config | ||
4. license | ||
5. webpack config | ||
6. tsconfig | ||
7. tslint | ||
8. do not commit anything in dist folder | ||
|
||
These are the files which contains some config & makes the jsstore bug free thats why we dont want user to change as thing may become messy. But we understand that sometimes you need to change these things, so in that case please give a description files name with reason of why you need to change in the pull request. | ||
|
||
## Documentation | ||
|
||
If you find some mistakes ( anything like spelling or design etc.) or want to improve the docs. Please feel free to send the PR. | ||
|
||
Our documentation is on another repo - https://github.com/ujjwalguptaofficial/fortjs.docs . So please have a look at contrubuting guidelines. | ||
|
||
## Learning Contribution | ||
|
||
Learning can be promoted by many ways like - | ||
|
||
* An article | ||
* Examples | ||
* Tutorial - text or video | ||
|
||
If you have anything that helps users learn fortjs and you want them to list on our board. Feel free to link those in our get_started page. | ||
|
||
## Setup | ||
|
||
Setting up fortjs in your local is very easy - | ||
|
||
* Just fork and clone from your repo list or just clone from jsstore repos | ||
* Run npm install - this will install all dependencies | ||
* There are multiple commands that you can see in package.json. | ||
|
||
#### Commands | ||
|
||
* lint - Run linter for every codes | ||
* build - build the codes & create a bundle | ||
* deploy - This is used when some new version is to be deployed. | ||
|
||
## Submitting Changes | ||
|
||
Push to your repo and submit a pull request. We | ||
may suggest some changes or improvements or alternatives, but for small changes | ||
your pull request should be accepted quickly. | ||
|
||
Some things that will increase the chance that your pull request is accepted: | ||
|
||
* Follow the existing coding style | ||
* Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) | ||
* Do not add anything inside the dist folder | ||
|
||
## Discussions | ||
|
||
You can discuss on [Gitter](https://gitter.im/fortjs/Lobby). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.