diff --git a/packages/neos-ts-interfaces/src/index.ts b/packages/neos-ts-interfaces/src/index.ts index 47502fbc99..2094cfd9bc 100644 --- a/packages/neos-ts-interfaces/src/index.ts +++ b/packages/neos-ts-interfaces/src/index.ts @@ -13,7 +13,6 @@ export interface DimensionCombination { [propName: string]: DimensionValues; } - export interface DimensionPresetCombination { [propName: string]: DimensionPresetName; } diff --git a/packages/neos-ui-backend-connector/src/Endpoints/index.ts b/packages/neos-ui-backend-connector/src/Endpoints/index.ts index 753b3666e5..0621a0f6dd 100644 --- a/packages/neos-ui-backend-connector/src/Endpoints/index.ts +++ b/packages/neos-ui-backend-connector/src/Endpoints/index.ts @@ -279,7 +279,6 @@ export default (routes: Routes) => { assetProxyTable.innerHTML = result; const assetProxies = Array.from(assetProxyTable.querySelectorAll('.asset-proxy')) as HTMLElement[]; - const mappedAssetProxies = assetProxies.map((assetProxy: HTMLElement) => { const assetSourceIdentifier = getElementInnerText(assetProxy, '.asset-source-identifier'); const assetSourceLabel = getElementInnerText(assetProxy, '.asset-source-label'); @@ -650,7 +649,7 @@ export default (routes: Routes) => { }, body: JSON.stringify({ contextNode: nodeContextPath, - text, + text }) })) .then(response => fetchWithErrorHandling.parseJson(response)) diff --git a/packages/neos-ui-backend-connector/src/index.ts b/packages/neos-ui-backend-connector/src/index.ts index 8b1cc854b8..995cfd2711 100644 --- a/packages/neos-ui-backend-connector/src/index.ts +++ b/packages/neos-ui-backend-connector/src/index.ts @@ -41,7 +41,6 @@ export const initializeJsAPI = (parent: {[propName: string]: any}, {alias = 'neo return parent[alias]; }; - // // Expose methods to access the initialized api // diff --git a/packages/neos-ui-contentrepository/src/registry/NodeTypesRegistry.ts b/packages/neos-ui-contentrepository/src/registry/NodeTypesRegistry.ts index 240e18c1ad..3b9a9e4950 100644 --- a/packages/neos-ui-contentrepository/src/registry/NodeTypesRegistry.ts +++ b/packages/neos-ui-contentrepository/src/registry/NodeTypesRegistry.ts @@ -41,7 +41,7 @@ interface ViewConfiguration { [prop: string]: any; } // We have to use a custom type guard in order to filter out null values, see https://codereview.stackexchange.com/a/184004 -const isGroupedNodeTypeListItem = (str: GroupedNodeTypeListItem | null): str is GroupedNodeTypeListItem => !!str; +const isGroupedNodeTypeListItem = (str: GroupedNodeTypeListItem | null): str is GroupedNodeTypeListItem => Boolean(str); export default class NodeTypesRegistry extends SynchronousRegistry { private _constraints: ConstraintsMap = {}; @@ -56,7 +56,7 @@ export default class NodeTypesRegistry extends SynchronousRegistry { private _inspectorViewConfigurationCache: {[propName: string]: any} = {}; - public setConstraints (constraints: ConstraintsMap): void { + public setConstraints(constraints: ConstraintsMap): void { this._constraints = constraints; } @@ -80,9 +80,8 @@ export default class NodeTypesRegistry extends SynchronousRegistry { const role = this.getRole(roleName); if (role) { return this.isOfType(nodeTypeName, role); - } else { - return false; } + return false; } public getAllowedChildNodeTypes(nodeTypeName: string): NodeTypeName[] { @@ -201,9 +200,9 @@ export default class NodeTypesRegistry extends SynchronousRegistry { return isMatch || isDefaultTab; }).map(group => ({ - ...group, - items: positionalArraySorter([ - ...properties.filter(p => $get(['ui', 'inspector', 'group'], p) === group.id) + ...group, + items: positionalArraySorter([ + ...properties.filter(p => $get(['ui', 'inspector', 'group'], p) === group.id) .map(property => ({ type: 'editor', id: $get(['id'], property), @@ -216,7 +215,7 @@ export default class NodeTypesRegistry extends SynchronousRegistry { helpThumbnail: $get(['ui', 'help', 'thumbnail'], property) }) ), - ...views.filter(v => $get(['group'], v) === group.id) + ...views.filter(v => $get(['group'], v) === group.id) .map(property => ({ type: 'view', id: $get(['id'], property), @@ -227,8 +226,8 @@ export default class NodeTypesRegistry extends SynchronousRegistry { helpMessage: $get(['helpMessage'], property) }) ) - ], 'position', 'id') - }) + ], 'position', 'id') + }) ) })) }; diff --git a/packages/neos-ui-decorators/src/neos.tsx b/packages/neos-ui-decorators/src/neos.tsx index cd1639d9c2..7e073784b5 100644 --- a/packages/neos-ui-decorators/src/neos.tsx +++ b/packages/neos-ui-decorators/src/neos.tsx @@ -21,7 +21,6 @@ export const NeosContext = React.createContext(null // configuration export default (mapRegistriesToProps: (globalRegistry: GlobalRegistry) => any) => (WrappedComponent: React.ComponentType) => { const Decorator = class NeosDecorator extends React.PureComponent { - public static readonly Original = WrappedComponent; public static readonly contextType = NeosContext; diff --git a/packages/neos-ui-editors/src/SecondaryEditors/CodeMirrorWrap/index.js b/packages/neos-ui-editors/src/SecondaryEditors/CodeMirrorWrap/index.js index 12f231f39c..bd996a5974 100644 --- a/packages/neos-ui-editors/src/SecondaryEditors/CodeMirrorWrap/index.js +++ b/packages/neos-ui-editors/src/SecondaryEditors/CodeMirrorWrap/index.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import {UnControlled as CodeMirror} from 'react-codemirror2'; // TODO: Find way to dynamically load any mode? -/* eslint-disable no-unused-vars */ +/* eslint-disable @typescript-eslint/no-unused-vars */ import XmlMode from 'codemirror/mode/xml/xml'; import HtmlMixedMode from 'codemirror/mode/htmlmixed/htmlmixed'; import JavascriptMode from 'codemirror/mode/javascript/javascript'; @@ -12,7 +12,7 @@ import MarkdownMode from 'codemirror/mode/markdown/markdown'; import YamlMode from 'codemirror/mode/yaml/yaml'; import Styles from './codemirror.vanilla-css'; import ThemeStyles from './codemirror-twilight.vanilla-css'; -/* eslint-enable no-unused-vars */ +/* eslint-enable @typescript-eslint/no-unused-vars */ export default class CodeMirrorWrap extends PureComponent { static propTypes = { diff --git a/packages/neos-ui-editors/src/SecondaryEditors/ImageCropper/index.js b/packages/neos-ui-editors/src/SecondaryEditors/ImageCropper/index.js index a8047e3060..55ffa5565a 100644 --- a/packages/neos-ui-editors/src/SecondaryEditors/ImageCropper/index.js +++ b/packages/neos-ui-editors/src/SecondaryEditors/ImageCropper/index.js @@ -11,7 +11,7 @@ import AspectRatioDropDown from './AspectRatioDropDown/index'; import CropConfiguration, {CustomAspectRatioOption, LockedAspectRatioStrategy} from './model.js'; import style from './style.css'; -/* eslint-disable no-unused-vars */ +/* eslint-disable @typescript-eslint/no-unused-vars */ import ReactCropStyles from './react_crop.vanilla-css'; /* eslint-enable no-unused-vars */ import {$get} from 'plow-js'; diff --git a/packages/neos-ui-extensibility/src/readFromConsumerApi.ts b/packages/neos-ui-extensibility/src/readFromConsumerApi.ts index 29b106c31b..5f1f2c330d 100644 --- a/packages/neos-ui-extensibility/src/readFromConsumerApi.ts +++ b/packages/neos-ui-extensibility/src/readFromConsumerApi.ts @@ -4,6 +4,6 @@ export default function readFromConsumerApi(key: string): (...args: any[]) => an return (window as any)['@Neos:HostPluginAPI'][`@${key}`](...args); } - throw new Error("You are trying to read from a consumer api that hasn't been initialized yet!"); + throw new Error('You are trying to read from a consumer api that hasn\'t been initialized yet!'); }; } diff --git a/packages/neos-ui-extensibility/src/registry/AbstractRegistry.ts b/packages/neos-ui-extensibility/src/registry/AbstractRegistry.ts index 79124a0cad..c1ca3deb38 100644 --- a/packages/neos-ui-extensibility/src/registry/AbstractRegistry.ts +++ b/packages/neos-ui-extensibility/src/registry/AbstractRegistry.ts @@ -1,5 +1,6 @@ export default class AbstractRegistry { public SERIAL_VERSION_UID = 'd8a5aa78-978e-11e6-ae22-56b6b6499611'; + public description: string; constructor(description: string) { diff --git a/packages/neos-ui-redux-store/src/CR/ContentDimensions/index.ts b/packages/neos-ui-redux-store/src/CR/ContentDimensions/index.ts index f68a3dc625..aab15c8382 100644 --- a/packages/neos-ui-redux-store/src/CR/ContentDimensions/index.ts +++ b/packages/neos-ui-redux-store/src/CR/ContentDimensions/index.ts @@ -52,7 +52,7 @@ export const actions = { /** * Sets the currently allowed presets for dimension */ - setAllowed: (dimensionName: string, allowedPresets: DimensionPresetName[]) => createAction(actionTypes.SET_ALLOWED, {dimensionName, allowedPresets}) + setAllowed: (dimensionName: string, allowedPresets: DimensionPresetName[]) => createAction(actionTypes.SET_ALLOWED, {dimensionName, allowedPresets}) }; // @@ -67,7 +67,7 @@ export const reducer = (state: State = defaultState, action: InitAction | Action break; } case actionTypes.SELECT_PRESET: { - const targetPresets = action.payload.targetPresets; + const {targetPresets} = action.payload; Object.keys(targetPresets).forEach(dimensionName => { const presetName = targetPresets[dimensionName]; const dimensionValues = state.byName[dimensionName].presets[presetName].values; @@ -78,7 +78,7 @@ export const reducer = (state: State = defaultState, action: InitAction | Action break; } case actionTypes.SET_ACTIVE: { - const dimensionValues = action.payload.dimensionValues; + const {dimensionValues} = action.payload; const previousActive = state.active; if (previousActive !== null) { Object.keys(previousActive).forEach(dimensionName => { @@ -165,7 +165,7 @@ const activePresetsSelector = createSelector([ if (active !== null) { return mapValues(active, (dimensionValues, name) => { const dimensionConfiguration = byName[name]; - const presets = dimensionConfiguration.presets; + const {presets} = dimensionConfiguration; const activePreset = Object.keys(presets).find(dimensionName => isEqual(presets[dimensionName].values, dimensionValues)); const presetName = activePreset || dimensionConfiguration.defaultPreset; const finalActivePreset = presets[presetName]; diff --git a/packages/neos-ui-redux-store/src/CR/Nodes/helpers.ts b/packages/neos-ui-redux-store/src/CR/Nodes/helpers.ts index 3a159e0c58..457f3bfe43 100644 --- a/packages/neos-ui-redux-store/src/CR/Nodes/helpers.ts +++ b/packages/neos-ui-redux-store/src/CR/Nodes/helpers.ts @@ -61,7 +61,8 @@ export const getNodeOrThrow = (nodeMap: NodeMap, contextPath: NodeContextPath) = export const calculateNewFocusedNodes = (selectionMode: SelectionModeTypes, contextPath: NodeContextPath, focusedNodesContextPaths: NodeContextPath[], nodesByContextPath: NodeMap): NodeContextPath[] | null => { if (selectionMode === SelectionModeTypes.SINGLE_SELECT) { return [contextPath]; - } else if (selectionMode === SelectionModeTypes.RANGE_SELECT) { + } + if (selectionMode === SelectionModeTypes.RANGE_SELECT) { const lastSelectedNodeContextPath = focusedNodesContextPaths[focusedNodesContextPaths.length - 1]; const lastSelectedNode = nodesByContextPath[lastSelectedNodeContextPath]; if (lastSelectedNode && lastSelectedNode.parent) { @@ -74,9 +75,8 @@ export const calculateNewFocusedNodes = (selectionMode: SelectionModeTypes, cont if (startSelectionFlag) { // if matches for the second time it means that both start and end of selection were found tempSelection.push(child.contextPath); // also push the last node return true; - } else { - startSelectionFlag = true; } + startSelectionFlag = true; } if (startSelectionFlag) { tempSelection.push(child.contextPath); diff --git a/packages/neos-ui-redux-store/src/CR/Nodes/index.ts b/packages/neos-ui-redux-store/src/CR/Nodes/index.ts index 4ebf608952..677a9a8954 100644 --- a/packages/neos-ui-redux-store/src/CR/Nodes/index.ts +++ b/packages/neos-ui-redux-store/src/CR/Nodes/index.ts @@ -496,8 +496,8 @@ export const reducer = (state: State = defaultState, action: InitAction | Action // Update the context path for stored descendant of the moved node including the node itself Object.keys(draft.byContextPath).forEach(contextPath => { // Skip nodes that don't match the old path exactly or a descendant path - if (!contextPath.startsWith(oldPath + '/') - && contextPath.split('@')[0] !== oldPath) { + if (!contextPath.startsWith(oldPath + '/') && + contextPath.split('@')[0] !== oldPath) { return; } @@ -518,7 +518,7 @@ export const reducer = (state: State = defaultState, action: InitAction | Action child.contextPath = child.contextPath.replace(oldPath, newPath); }); - delete Object.assign(draft.byContextPath, {[updatedContextPath]: node })[contextPath]; + delete Object.assign(draft.byContextPath, {[updatedContextPath]: node})[contextPath]; }); break; } diff --git a/packages/neos-ui-redux-store/src/CR/Nodes/selectors.ts b/packages/neos-ui-redux-store/src/CR/Nodes/selectors.ts index 0443426437..eed7cf09ea 100644 --- a/packages/neos-ui-redux-store/src/CR/Nodes/selectors.ts +++ b/packages/neos-ui-redux-store/src/CR/Nodes/selectors.ts @@ -12,9 +12,9 @@ export const focusedNodePathsSelector = (state: GlobalState) => $get(['cr', 'nod // This is internal, as in most cases you want `focusedNodePathSelector`, which is able to fallback to documentNode, when no node is focused export const _focusedNodeContextPathSelector = createSelector( [ - focusedNodePathsSelector, + focusedNodePathsSelector ], - (focusedNodePaths) => { + focusedNodePaths => { return focusedNodePaths && focusedNodePaths[0] ? focusedNodePaths[0] : null; } ); @@ -289,7 +289,6 @@ export const makeGetAllowedChildNodeTypesSelector = (nodeTypesRegistry: NodeType export const makeGetAllowedSiblingNodeTypesSelector = (nodeTypesRegistry: NodeTypesRegistry) => makeGetAllowedChildNodeTypesSelector(nodeTypesRegistry, (nodeContextPath, state) => getPathInNode(state, nodeContextPath, 'parent')); - export const makeIsAllowedToAddChildOrSiblingNodes = (nodeTypesRegistry: NodeTypesRegistry) => createSelector( [ makeGetAllowedChildNodeTypesSelector(nodeTypesRegistry), @@ -408,7 +407,7 @@ export const focusedNodeParentLineSelector = createSelector( let currentNode = focusedNode; while (currentNode) { - const parent = currentNode.parent; + const {parent} = currentNode; if (parent) { currentNode = nodesByContextPath[parent] || null; if (currentNode) { diff --git a/packages/neos-ui-redux-store/src/CR/Workspaces/index.ts b/packages/neos-ui-redux-store/src/CR/Workspaces/index.ts index 7a81ad1d8e..8fd232e7e3 100644 --- a/packages/neos-ui-redux-store/src/CR/Workspaces/index.ts +++ b/packages/neos-ui-redux-store/src/CR/Workspaces/index.ts @@ -68,7 +68,7 @@ const abortDiscard = () => createAction(actionTypes.DISCARD_ABORTED); /** * Confirm the ongoing discard */ -const confirmDiscard = () => createAction(actionTypes.DISCARD_CONFIRMED); +const confirmDiscard = () => createAction(actionTypes.DISCARD_CONFIRMED); /** * Change base workspace diff --git a/packages/neos-ui-redux-store/src/CR/Workspaces/selectors.ts b/packages/neos-ui-redux-store/src/CR/Workspaces/selectors.ts index 7e17e19641..a6fce8fb53 100644 --- a/packages/neos-ui-redux-store/src/CR/Workspaces/selectors.ts +++ b/packages/neos-ui-redux-store/src/CR/Workspaces/selectors.ts @@ -4,8 +4,6 @@ import {documentNodeContextPathSelector} from '../Nodes/selectors'; import {GlobalState} from '../../System'; import {NodeContextPath} from '@neos-project/neos-ts-interfaces'; - - export const personalWorkspaceNameSelector = (state: GlobalState) => $get(['cr', 'workspaces', 'personalWorkspace', 'name'], state); export const baseWorkspaceSelector = (state: GlobalState) => $get(['cr', 'workspaces', 'personalWorkspace', 'baseWorkspace'], state); diff --git a/packages/neos-ui-redux-store/src/CR/index.ts b/packages/neos-ui-redux-store/src/CR/index.ts index ccd5fd4c1e..ee7e9d673f 100644 --- a/packages/neos-ui-redux-store/src/CR/index.ts +++ b/packages/neos-ui-redux-store/src/CR/index.ts @@ -1,6 +1,5 @@ import {combineReducers} from '../combineReducers'; - import * as ContentDimensions from './ContentDimensions'; import * as Nodes from './Nodes'; import * as Workspaces from './Workspaces'; diff --git a/packages/neos-ui-redux-store/src/ServerFeedback/index.ts b/packages/neos-ui-redux-store/src/ServerFeedback/index.ts index fb3160fedc..dd36dbbc7a 100644 --- a/packages/neos-ui-redux-store/src/ServerFeedback/index.ts +++ b/packages/neos-ui-redux-store/src/ServerFeedback/index.ts @@ -2,7 +2,6 @@ import {action as createAction, ActionType} from 'typesafe-actions'; // import {handleActions} from '@neos-project/utils-redux'; - // // Export the action types // diff --git a/packages/neos-ui-redux-store/src/UI/AddNodeModal/index.ts b/packages/neos-ui-redux-store/src/UI/AddNodeModal/index.ts index 59804e5194..cbf481ac1c 100644 --- a/packages/neos-ui-redux-store/src/UI/AddNodeModal/index.ts +++ b/packages/neos-ui-redux-store/src/UI/AddNodeModal/index.ts @@ -33,7 +33,7 @@ export enum actionTypes { * @param {Object} fusionPath (optional) fusion path of the rendered node relative to which the new node ought to be * positioned. */ -const open = (contextPath: NodeContextPath, fusionPath: FusionPath = '') => createAction(actionTypes.OPEN, {contextPath, fusionPath}); +const open = (contextPath: NodeContextPath, fusionPath: FusionPath = '') => createAction(actionTypes.OPEN, {contextPath, fusionPath}); /** * Closes the add node modal. diff --git a/packages/neos-ui-redux-store/src/UI/ContentCanvas/index.ts b/packages/neos-ui-redux-store/src/UI/ContentCanvas/index.ts index 0a552be122..cf9df06892 100644 --- a/packages/neos-ui-redux-store/src/UI/ContentCanvas/index.ts +++ b/packages/neos-ui-redux-store/src/UI/ContentCanvas/index.ts @@ -53,8 +53,8 @@ export enum actionTypes { TOGGLE_LINK_EDITOR = '@neos/neos-ui/UI/ContentCanvas/TOGGLE_LINK_EDITOR' } -const setPreviewUrl = (previewUrl: string) => createAction(actionTypes.SET_PREVIEW_URL, previewUrl); -const setSrc = (src: string, metaKeyPressed: boolean = false) => createAction(actionTypes.SET_SRC, {src, metaKeyPressed}); +const setPreviewUrl = (previewUrl: string) => createAction(actionTypes.SET_PREVIEW_URL, previewUrl); +const setSrc = (src: string, metaKeyPressed: boolean = false) => createAction(actionTypes.SET_SRC, {src, metaKeyPressed}); const setFormattingUnderCursor = (formatting: Formatting) => createAction(actionTypes.FORMATTING_UNDER_CURSOR, formatting); const setCurrentlyEditedPropertyName = (propertyName: string) => createAction(actionTypes.SET_CURRENTLY_EDITED_PROPERTY_NAME, propertyName); const startLoading = () => createAction(actionTypes.START_LOADING); diff --git a/packages/neos-ui-redux-store/src/UI/ContentTree/index.ts b/packages/neos-ui-redux-store/src/UI/ContentTree/index.ts index d0e46158c6..aa7c933115 100644 --- a/packages/neos-ui-redux-store/src/UI/ContentTree/index.ts +++ b/packages/neos-ui-redux-store/src/UI/ContentTree/index.ts @@ -37,7 +37,7 @@ const toggle = (contextPath: NodeContextPath) => createAction(actionTypes.TOGGLE const startLoading = () => createAction(actionTypes.START_LOADING); const stopLoading = () => createAction(actionTypes.STOP_LOADING); const reloadTree = () => createAction(actionTypes.RELOAD_TREE); -const requestChildren = (contextPath: NodeContextPath, {unCollapse = true, activate = false} = {}) => createAction(actionTypes.REQUEST_CHILDREN, {contextPath, opts: {unCollapse, activate}}); +const requestChildren = (contextPath: NodeContextPath, {unCollapse = true, activate = false} = {}) => createAction(actionTypes.REQUEST_CHILDREN, {contextPath, opts: {unCollapse, activate}}); const setAsLoading = (contextPath: NodeContextPath) => createAction(actionTypes.SET_AS_LOADING, {contextPath}); const setAsLoaded = (contextPath: NodeContextPath) => createAction(actionTypes.SET_AS_LOADED, {contextPath}); @@ -79,13 +79,13 @@ export const reducer = (state: State = defaultState, action: InitAction | Action break; } case actionTypes.SET_AS_LOADING: { - const contextPath = action.payload.contextPath; + const {contextPath} = action.payload; draft.errors = draft.errors.filter(i => i !== contextPath); draft.loading.push(contextPath); break; } case actionTypes.SET_AS_LOADED: { - const contextPath = action.payload.contextPath; + const {contextPath} = action.payload; draft.loading = draft.loading.filter(i => i !== contextPath); break; } diff --git a/packages/neos-ui-redux-store/src/UI/Inspector/index.ts b/packages/neos-ui-redux-store/src/UI/Inspector/index.ts index 21392198cc..f5a39211ac 100644 --- a/packages/neos-ui-redux-store/src/UI/Inspector/index.ts +++ b/packages/neos-ui-redux-store/src/UI/Inspector/index.ts @@ -22,7 +22,6 @@ export const defaultState: State = { valuesByNodePath: {} }; - // // Export the action types // diff --git a/packages/neos-ui-redux-store/src/UI/KeyboardShortcutModal/index.ts b/packages/neos-ui-redux-store/src/UI/KeyboardShortcutModal/index.ts index 492be70732..00e0d88043 100644 --- a/packages/neos-ui-redux-store/src/UI/KeyboardShortcutModal/index.ts +++ b/packages/neos-ui-redux-store/src/UI/KeyboardShortcutModal/index.ts @@ -11,7 +11,6 @@ export const defaultState: State = { isOpen: false }; - // // Export the action types // diff --git a/packages/neos-ui-redux-store/src/UI/LeftSideBar/index.ts b/packages/neos-ui-redux-store/src/UI/LeftSideBar/index.ts index b189217693..95eb9822d1 100644 --- a/packages/neos-ui-redux-store/src/UI/LeftSideBar/index.ts +++ b/packages/neos-ui-redux-store/src/UI/LeftSideBar/index.ts @@ -9,7 +9,7 @@ export interface State extends Readonly<{ contentTree: { isHidden: boolean; }, - searchBar: { + searchBar: { isVisible: boolean; }; }> {} @@ -24,8 +24,6 @@ export const defaultState: State = { } }; - - // // Export the action types // diff --git a/packages/neos-ui-redux-store/src/UI/NodeVariantCreationDialog/index.ts b/packages/neos-ui-redux-store/src/UI/NodeVariantCreationDialog/index.ts index 76bbcf8ef2..3a45155199 100644 --- a/packages/neos-ui-redux-store/src/UI/NodeVariantCreationDialog/index.ts +++ b/packages/neos-ui-redux-store/src/UI/NodeVariantCreationDialog/index.ts @@ -69,5 +69,5 @@ export const reducer = (state: State = defaultState, action: InitAction | Action export const selectors = { isOpen: (state: GlobalState) => $get(['ui', 'nodeVariantCreationDialog', 'isOpen'], state), - numberOfParentNodesToBeCreated: (state: GlobalState) => $get(['ui', 'nodeVariantCreationDialog', 'numberOfParentNodesToBeCreated'], state), + numberOfParentNodesToBeCreated: (state: GlobalState) => $get(['ui', 'nodeVariantCreationDialog', 'numberOfParentNodesToBeCreated'], state) }; diff --git a/packages/neos-ui-redux-store/src/UI/PageTree/index.ts b/packages/neos-ui-redux-store/src/UI/PageTree/index.ts index bac056e1d4..8b55561600 100644 --- a/packages/neos-ui-redux-store/src/UI/PageTree/index.ts +++ b/packages/neos-ui-redux-store/src/UI/PageTree/index.ts @@ -46,7 +46,7 @@ export enum actionTypes { const focus = (contextPath: NodeContextPath, _: undefined, selectionMode: SelectionModeTypes = SelectionModeTypes.SINGLE_SELECT) => createAction(actionTypes.FOCUS, {contextPath, selectionMode}); const toggle = (contextPath: NodeContextPath) => createAction(actionTypes.TOGGLE, {contextPath}); const invalidate = (contextPath: NodeContextPath) => createAction(actionTypes.INVALIDATE, {contextPath}); -const requestChildren = (contextPath: NodeContextPath, {unCollapse = true, activate = false} = {}) => createAction(actionTypes.REQUEST_CHILDREN, {contextPath, opts: {unCollapse, activate}}); +const requestChildren = (contextPath: NodeContextPath, {unCollapse = true, activate = false} = {}) => createAction(actionTypes.REQUEST_CHILDREN, {contextPath, opts: {unCollapse, activate}}); const setAsLoading = (contextPath: NodeContextPath) => createAction(actionTypes.SET_AS_LOADING, {contextPath}); const setAsLoaded = (contextPath: NodeContextPath) => createAction(actionTypes.SET_AS_LOADED, {contextPath}); interface CommenceSearchOptions extends Readonly<{ @@ -96,7 +96,7 @@ export const reducer = (state: State = defaultState, action: InitAction | Action break; } case actionTypes.TOGGLE: { - const contextPath = action.payload.contextPath; + const {contextPath} = action.payload; if (draft.toggled.includes(contextPath)) { draft.toggled = draft.toggled.filter(i => i !== contextPath); } else { @@ -105,20 +105,20 @@ export const reducer = (state: State = defaultState, action: InitAction | Action break; } case actionTypes.INVALIDATE: { - const contextPath = action.payload.contextPath; + const {contextPath} = action.payload; draft.toggled = draft.toggled.filter(i => i !== contextPath); draft.loading = draft.loading.filter(i => i !== contextPath); draft.errors.push(contextPath); break; } case actionTypes.SET_AS_LOADING: { - const contextPath = action.payload.contextPath; + const {contextPath} = action.payload; draft.errors = draft.errors.filter(i => i !== contextPath); draft.loading.push(contextPath); break; } case actionTypes.SET_AS_LOADED: { - const contextPath = action.payload.contextPath; + const {contextPath} = action.payload; draft.loading = draft.loading.filter(i => i !== contextPath); break; } diff --git a/packages/neos-ui-redux-store/src/UI/index.ts b/packages/neos-ui-redux-store/src/UI/index.ts index 8344c5604c..e96a020250 100644 --- a/packages/neos-ui-redux-store/src/UI/index.ts +++ b/packages/neos-ui-redux-store/src/UI/index.ts @@ -77,7 +77,6 @@ export const actionTypes = typedKeys(all).reduce((acc, cur) => ({...acc, [cur]: // export const actions = typedKeys(all).reduce((acc, cur) => ({...acc, [cur]: all[cur].actions}), {}); - // // Export the reducer // diff --git a/packages/neos-ui-redux-store/src/User/Impersonate/index.ts b/packages/neos-ui-redux-store/src/User/Impersonate/index.ts index a7450280be..13a9a6915c 100644 --- a/packages/neos-ui-redux-store/src/User/Impersonate/index.ts +++ b/packages/neos-ui-redux-store/src/User/Impersonate/index.ts @@ -1,7 +1,7 @@ import {produce} from 'immer'; import {action as createAction, ActionType} from 'typesafe-actions'; import {InitAction} from '../../System'; -import { WritableDraft } from 'immer/dist/internal'; +import {WritableDraft} from 'immer/dist/internal'; export interface ImpersonateAccount extends WritableDraft<{ accountIdentifier: string; @@ -18,7 +18,6 @@ export const defaultState: State = { status: false }; - // // Export the action types // @@ -34,7 +33,7 @@ export enum actionTypes { export const actions = { init: () => createAction(actionTypes.INIT), fetchStatus: (data: State) => createAction(actionTypes.FETCH_STATUS, data), - restore: () => createAction(actionTypes.RESTORE), + restore: () => createAction(actionTypes.RESTORE) }; // diff --git a/packages/neos-ui-sagas/src/Changes/saveHooks.spec.ts b/packages/neos-ui-sagas/src/Changes/saveHooks.spec.ts index 12bdd3144c..fc4af8839b 100644 --- a/packages/neos-ui-sagas/src/Changes/saveHooks.spec.ts +++ b/packages/neos-ui-sagas/src/Changes/saveHooks.spec.ts @@ -9,7 +9,7 @@ test('applySaveHooksForTransientValue does nothing if a given transient value ha const process = applySaveHooksForTransientValue(transientValue, saveHooksRegistry); - const { value, done } = process.next(); + const {value, done} = process.next(); expect(done).toBe(true); expect(value).toBe(1); @@ -38,14 +38,14 @@ test('applySaveHooksForTransientValue applies registered save hooks to a given t process.next(); expect(saveHooksRegistry.get).toBeCalledWith('AddNumber'); - expect(addNumberHook).toBeCalledWith(1, { number: 2 }); + expect(addNumberHook).toBeCalledWith(1, {number: 2}); process.next(3); expect(saveHooksRegistry.get).toBeCalledWith('SubtractNumber'); - expect(subtractNumberHook).toBeCalledWith(3, { number: 1 }); + expect(subtractNumberHook).toBeCalledWith(3, {number: 1}); - const { value, done } = process.next(2); + const {value, done} = process.next(2); expect(done).toBe(true); expect(value).toBe(2); @@ -80,7 +80,9 @@ test('applySaveHooksForTransientValue will throw an error if a specified saveHoo } }; const saveHooksRegistry = { - get: jest.fn(() => () => { throw new Error(); }) + get: jest.fn(() => () => { + throw new Error(); + }) }; const process = applySaveHooksForTransientValue(transientValue, saveHooksRegistry); @@ -120,14 +122,14 @@ test('applySaveHooksForTransientValuesMap applies registered save hooks to multi process.next(); expect(saveHooksRegistry.get).toBeCalledWith('Multiply'); - expect(multiplyHook).toBeCalledWith(100, { by: 10 }); + expect(multiplyHook).toBeCalledWith(100, {by: 10}); process.next(1000); expect(saveHooksRegistry.get).toBeCalledWith('Multiply'); - expect(multiplyHook).toBeCalledWith(100, { by: 5 }); + expect(multiplyHook).toBeCalledWith(100, {by: 5}); - const { value, done } = process.next(500); + const {value, done} = process.next(500); expect(done).toBe(true); expect(value).toEqual({ diff --git a/packages/neos-ui-sagas/src/Changes/saveHooks.ts b/packages/neos-ui-sagas/src/Changes/saveHooks.ts index 8bde561739..c6f5c9fe7a 100644 --- a/packages/neos-ui-sagas/src/Changes/saveHooks.ts +++ b/packages/neos-ui-sagas/src/Changes/saveHooks.ts @@ -23,7 +23,7 @@ export function * applySaveHooksForTransientValue( transientValue: TransientValue, saveHooksRegistry: SaveHooksRegistry ): Generator, Value, Value> { - let value: Value = transientValue.value; + let {value} = transientValue; if (transientValue.hooks) { for (const [saveHookIdentifier, saveHookOptions] of Object.entries(transientValue.hooks)) { @@ -56,7 +56,7 @@ export function * applySaveHooksForTransientValuesMap( if (transientValues) { for (const [elementName, transientValue] of Object.entries(transientValues)) { - result[elementName] = yield* applySaveHooksForTransientValue( + result[elementName] = yield * applySaveHooksForTransientValue( transientValue, saveHooksRegistry ); diff --git a/packages/positional-array-sorter/src/positionalArraySorter.ts b/packages/positional-array-sorter/src/positionalArraySorter.ts index ff63461f16..c614312295 100644 --- a/packages/positional-array-sorter/src/positionalArraySorter.ts +++ b/packages/positional-array-sorter/src/positionalArraySorter.ts @@ -59,16 +59,14 @@ const positionalArraySorter = (subject: T, position: string | startKeys[weight] = []; } startKeys[weight].push(key); - } - else if (position.startsWith('end')) { + } else if (position.startsWith('end')) { const weightMatch = position.match(/end\s+(\d+)/); const weight = weightMatch && weightMatch[1] ? Number(weightMatch[1]) : 0; if (!endKeys[weight]) { endKeys[weight] = []; } endKeys[weight].push(key); - } - else if (position.startsWith('before')) { + } else if (position.startsWith('before')) { const match = position.match(/before\s+(\S+)(\s+(\d+))?/); if (!match) { invalid = true; @@ -83,8 +81,7 @@ const positionalArraySorter = (subject: T, position: string | } beforeKeys[reference][weight].push(key); } - } - else if (position.startsWith('after')) { + } else if (position.startsWith('after')) { const match = position.match(/after\s+(\S+)(\s+(\d+))?/); if (!match) { invalid = true; @@ -99,8 +96,7 @@ const positionalArraySorter = (subject: T, position: string | } afterKeys[reference][weight].push(key); } - } - else { + } else { invalid = true; } if (invalid) {