Skip to content
This repository has been archived by the owner on May 6, 2023. It is now read-only.

Latest commit

 

History

History
35 lines (23 loc) · 1.13 KB

require-register-function-in-registration.md

File metadata and controls

35 lines (23 loc) · 1.13 KB

All registration.js file must export a registration function (require-register-function-in-registration)

Sharegate Apricot uses reflection to register routes. Since a route will be ignored if you forget to export a registration function, a feature might not work as intended

Rule Details

This rules aims to ensure that an route registration function is not forgotten in Sharegate Apricot.

Examples of incorrect code for this rule:

import { configurationPageRegistration } from "./settings-page/internal";

export function settingsRegistration(context) {
    context.registerAuthenticatedPage(configurationPageRegistration);
}

function register(context) {
    context.registerAuthenticatedPage(configurationPageRegistration);
}

Examples of correct code for this rule:

import { configurationPageRegistration } from "./settings-page/internal";

export function register(context) {
    context.registerAuthenticatedPage(configurationPageRegistration);
}

When Not To Use It

This rule is only intended for Sharegate Apricot's client application. If you are using another project, you can safely disable this rule.