nearbeach / NearBeach

NearBeach is an open sourced project management tool, helping you keep track of your project. You can track requirements, projects and tasks

Home Page:https://nearbeach.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

(JS-0682) Prefer default value for props

robotichead opened this issue · comments

commented

Description

It is recommended to have a default value for props that are not marked as required (except Boolean props). Default values are required as these values might not provide, so having a default value is recommended.

Occurrences

There are 130 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/robotichead/NearBeach/issue/JS-0682/occurrences/

Tips

The following are the preferred methods for each variable type;

variableA: {
    type: Number,
    default: 0,
},
variableB: {
    type: String,
    default: "",
},
variableC: Boolean, //Not needed for Booleans :D
variableD: {
    type: Array,
    default: function() {
        return [];
    },
},

Please note the array's default is.... .... .... a function.

@robotichead i would like to work on this issue, please assign this to me.