mirror of
https://github.com/nasa/openmct.git
synced 2025-06-15 13:48:12 +00:00
ESLint rules: array-callback-return, no-invalid-this, func-style (#3151)
* satisfied array-callback-return rule * satisfying no-invalid-this rule * fixed invalid-this issues * changed isNotEqual to arrow function * added rule func-style * added return false to satisfy array-callback-return rule Co-authored-by: Joel McKinnon <jmckinnon@apple.com> Co-authored-by: Joshi <simplyrender@gmail.com> Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
@ -7,7 +7,7 @@ const TIME_BOUNDS = {
|
||||
END_DELTA: 'tc.endDelta'
|
||||
};
|
||||
|
||||
export const getHistoricLinkInFixedMode = (openmct, bounds, historicLink) => {
|
||||
export function getHistoricLinkInFixedMode(openmct, bounds, historicLink) {
|
||||
if (historicLink.includes('tc.mode=fixed')) {
|
||||
return historicLink;
|
||||
}
|
||||
@ -35,9 +35,9 @@ export const getHistoricLinkInFixedMode = (openmct, bounds, historicLink) => {
|
||||
});
|
||||
|
||||
return params.join('&');
|
||||
};
|
||||
}
|
||||
|
||||
export const getNotebookDefaultEntries = (notebookStorage, domainObject) => {
|
||||
export function getNotebookDefaultEntries(notebookStorage, domainObject) {
|
||||
if (!notebookStorage || !domainObject) {
|
||||
return null;
|
||||
}
|
||||
@ -64,9 +64,9 @@ export const getNotebookDefaultEntries = (notebookStorage, domainObject) => {
|
||||
}
|
||||
|
||||
return entries[defaultSection.id][defaultPage.id];
|
||||
};
|
||||
}
|
||||
|
||||
export const createNewEmbed = (snapshotMeta, snapshot = '') => {
|
||||
export function createNewEmbed(snapshotMeta, snapshot = '') {
|
||||
const {
|
||||
bounds,
|
||||
link,
|
||||
@ -100,9 +100,9 @@ export const createNewEmbed = (snapshotMeta, snapshot = '') => {
|
||||
snapshot,
|
||||
type
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export const addNotebookEntry = (openmct, domainObject, notebookStorage, embed = null) => {
|
||||
export function addNotebookEntry(openmct, domainObject, notebookStorage, embed = null) {
|
||||
if (!openmct || !domainObject || !notebookStorage) {
|
||||
return;
|
||||
}
|
||||
@ -131,9 +131,9 @@ export const addNotebookEntry = (openmct, domainObject, notebookStorage, embed =
|
||||
openmct.objects.mutate(domainObject, 'configuration.entries', entries);
|
||||
|
||||
return id;
|
||||
};
|
||||
}
|
||||
|
||||
export const getNotebookEntries = (domainObject, selectedSection, selectedPage) => {
|
||||
export function getNotebookEntries(domainObject, selectedSection, selectedPage) {
|
||||
if (!domainObject || !selectedSection || !selectedPage) {
|
||||
return null;
|
||||
}
|
||||
@ -152,9 +152,9 @@ export const getNotebookEntries = (domainObject, selectedSection, selectedPage)
|
||||
}
|
||||
|
||||
return entries[selectedSection.id][selectedPage.id];
|
||||
};
|
||||
}
|
||||
|
||||
export const getEntryPosById = (entryId, domainObject, selectedSection, selectedPage) => {
|
||||
export function getEntryPosById(entryId, domainObject, selectedSection, selectedPage) {
|
||||
if (!domainObject || !selectedSection || !selectedPage) {
|
||||
return;
|
||||
}
|
||||
@ -170,9 +170,9 @@ export const getEntryPosById = (entryId, domainObject, selectedSection, selected
|
||||
});
|
||||
|
||||
return foundId;
|
||||
};
|
||||
}
|
||||
|
||||
export const deleteNotebookEntries = (openmct, domainObject, selectedSection, selectedPage) => {
|
||||
export function deleteNotebookEntries(openmct, domainObject, selectedSection, selectedPage) {
|
||||
if (!domainObject || !selectedSection) {
|
||||
return;
|
||||
}
|
||||
@ -194,4 +194,4 @@ export const deleteNotebookEntries = (openmct, domainObject, selectedSection, se
|
||||
|
||||
delete entries[selectedSection.id][selectedPage.id];
|
||||
openmct.objects.mutate(domainObject, 'configuration.entries', entries);
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user