First of all thank you for your interest in contributing to this project. We appreciate all the work that you plan to do to develop CogBoard
To see how to setup local environment see our Developer Setup Guide.
Check existing issues to make sure you don't create a duplicate.
Project License: Apache License 2.0
- You will only submit contributions where you have authored 100% of the content.
- You will only submit contributions to which you have the necessary rights. This means that if you are employed you have received the necessary permissions from your employer to make the contributions.
- Whatever content you contribute will be provided under the Project License(s).
To ensure commit messages are easy to read and descriptive enough please follow the How to Write a Git Commit Message guideline.
Pull requests need to follow provided Pull Request Template
CogBoard's documentation can be found in CogBoard Wiki.
Detekt is used to automatically check and format code on each build. Avoid wildcard imports. Keep in mind Detect issue threshold during the build.
Prettier is used to automatically format code before commiting changes (using pre-commit hook).
For the imports we use the order:
- Libraries and absolute imports.
- Helpers, utils, redux actions etc.
- Components.
import React from 'react';
import { func, object, string, bool, number } from 'prop-types';
import { useDispatch } from 'react-redux';
import { saveWidget } from '../actions/thunks';
import WidgetForm from './WidgetForm';
The project is using PropTypes to ensure that the data component receives is valid. Warning is shown in the JavaScript console when an invalid value is provided for a prop. Provide defaultProps for props that are not required.
import { string, number, bool } from 'prop-types';
TheComponent.propTypes = {
firstProperty: string.isRequired,
secondProperty: number,
thirdProperty: bool.isRequired
}
TheComponent.defaultProps = {
secondProperty: 1
}
Destructure props in function's inputs declaration.
const TheComponent = ({ firstProperty, secondProperty, thirdProperty }) -> {
// Component's code
}
All paths are relative to $PROJECT_ROOT/functional/cypress-tests/
- Testing data should be placed under
cypress/fixtures/
- Specs should be placed under
cypress/integration/
- Helper functions should be placed under
cypress/support/
- Configuration files should be placed under
cypress/config/
Existing ESLint rules:
- Unnecessary use of cy.wait(),
- No assigning of return values,
- Assertion before using cy.screenshot(),
- Single quotes,
- Newline per each chained call, for 2+ chained calls,
- Newline for each of argument if there 3+ arguments,
- 2 space indent
- Using semicolons
- Spacing after opening bracket and before closing bracket if they are on the same line
- Spaces between an after arrow function symbol
- Empty line on end of file
- Use const instead of let where possible