Commit 6a587bd9 authored by Andreas Fernandez's avatar Andreas Fernandez Committed by Georg Ringer
Browse files

[BUGFIX] Update tslint.json and fix build

This patch updates the definitions in tslint.json to use current settings
for TypeScript builds.

Most of the occurred issues were fixed by executing

  cd Build
  ./node_modules/tslint/bin/tslint -c tslint.json --fix --project .

Resolves: #87709
Releases: master, 9.5
Change-Id: Iba318b438a44f6de3fdfcacfb52a5bddef9c8002
Reviewed-on: https://review.typo3.org/c/59696


Tested-by: Susanne Moog's avatarSusanne Moog <susanne.moog@typo3.org>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Susanne Moog's avatarSusanne Moog <susanne.moog@typo3.org>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 97b3bbc5
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
"forin": true, "forin": true,
"indent": [ "indent": [
true, true,
"spaces",
2 2
], ],
"interface-name": false, "interface-name": false,
...@@ -28,9 +29,20 @@ ...@@ -28,9 +29,20 @@
], ],
"member-ordering": [ "member-ordering": [
true, true,
"public-before-private", {
"static-before-instance", "order": [
"variables-before-functions" "public-static-field",
"public-instance-field",
"private-static-field",
"private-instance-field",
"public-constructor",
"protected-constructor",
"private-constructor",
"public-instance-method",
"protected-instance-method",
"private-instance-method"
]
}
], ],
"no-any": false, "no-any": false,
"no-arg": true, "no-arg": true,
...@@ -52,10 +64,12 @@ ...@@ -52,10 +64,12 @@
"no-require-imports": false, "no-require-imports": false,
"no-string-literal": true, "no-string-literal": true,
"no-switch-case-fall-through": true, "no-switch-case-fall-through": true,
"trailing-comma": { "trailing-comma": [
"singleline": "never", true, {
"multiline": "always" "multiline": "always",
}, "singleline": "never"
}
],
"no-trailing-whitespace": true, "no-trailing-whitespace": true,
"no-unused-expression": true, "no-unused-expression": true,
"no-var-keyword": true, "no-var-keyword": true,
......
...@@ -41,7 +41,7 @@ declare namespace TYPO3 { ...@@ -41,7 +41,7 @@ declare namespace TYPO3 {
label: string, label: string,
title: string, title: string,
exclusiveValues?: string, exclusiveValues?: string,
$optionEl?: JQuery $optionEl?: JQuery,
): void; ): void;
public reinitialize(): void; public reinitialize(): void;
} }
...@@ -84,7 +84,7 @@ interface Window { ...@@ -84,7 +84,7 @@ interface Window {
$: any; $: any;
startInModule: Array<string>; startInModule: Array<string>;
inline: { inline: {
delayedImportElement: (objectId: number, table: string, uid: number, type: string) => void delayedImportElement: (objectId: number, table: string, uid: number, type: string) => void,
}; };
rawurlencode: Function; rawurlencode: Function;
list_frame: Window; list_frame: Window;
......
...@@ -15,7 +15,7 @@ namespace TYPO3 { ...@@ -15,7 +15,7 @@ namespace TYPO3 {
zoomTarget: '[data-typo3-zoom-target]', zoomTarget: '[data-typo3-zoom-target]',
zoomClose: '[data-typo3-zoom-close]', zoomClose: '[data-typo3-zoom-close]',
currentContentRole: '[data-typo3-role=typo3-adminPanel-content]', currentContentRole: '[data-typo3-role=typo3-adminPanel-content]',
contentPaneRole: '[data-typo3-role=typo3-adminPanel-content-pane]' contentPaneRole: '[data-typo3-role=typo3-adminPanel-content-pane]',
}; };
export const AdminPanelClasses = { export const AdminPanelClasses = {
...@@ -26,7 +26,7 @@ namespace TYPO3 { ...@@ -26,7 +26,7 @@ namespace TYPO3 {
activeTab: 'typo3-adminPanel-content-header-item-active', activeTab: 'typo3-adminPanel-content-header-item-active',
activePane: 'typo3-adminPanel-content-panes-item-active', activePane: 'typo3-adminPanel-content-panes-item-active',
noScroll: 'typo3-adminPanel-noscroll', noScroll: 'typo3-adminPanel-noscroll',
zoomShow: 'typo3-adminPanel-zoom-show' zoomShow: 'typo3-adminPanel-zoom-show',
}; };
export class AdminPanel { export class AdminPanel {
...@@ -43,16 +43,16 @@ namespace TYPO3 { ...@@ -43,16 +43,16 @@ namespace TYPO3 {
(moduleTrigger: HTMLElement) => { (moduleTrigger: HTMLElement) => {
const moduleParent = moduleTrigger.closest(AdminPanelSelectors.moduleParentClass); const moduleParent = moduleTrigger.closest(AdminPanelSelectors.moduleParentClass);
return new AdminPanelModule(this, moduleParent, moduleTrigger); return new AdminPanelModule(this, moduleParent, moduleTrigger);
} },
); );
this.popups = this.querySelectorAll(AdminPanelSelectors.popupTriggerRole).map( this.popups = this.querySelectorAll(AdminPanelSelectors.popupTriggerRole).map(
(popupTrigger: HTMLElement) => new AdminPanelPopup(this, popupTrigger) (popupTrigger: HTMLElement) => new AdminPanelPopup(this, popupTrigger),
); );
this.panels = this.querySelectorAll(AdminPanelSelectors.panelTriggerRole).map( this.panels = this.querySelectorAll(AdminPanelSelectors.panelTriggerRole).map(
(panelTrigger: HTMLElement) => { (panelTrigger: HTMLElement) => {
const panelParent = panelTrigger.closest(AdminPanelSelectors.panelParentClass); const panelParent = panelTrigger.closest(AdminPanelSelectors.panelParentClass);
return new AdminPanelPanel(panelParent, panelTrigger); return new AdminPanelPanel(panelParent, panelTrigger);
} },
); );
this.contentSettings = this.querySelectorAll(AdminPanelSelectors.contentSettingsTriggerRole).map( this.contentSettings = this.querySelectorAll(AdminPanelSelectors.contentSettingsTriggerRole).map(
(contentSettingTrigger: HTMLElement) => { (contentSettingTrigger: HTMLElement) => {
...@@ -60,7 +60,7 @@ namespace TYPO3 { ...@@ -60,7 +60,7 @@ namespace TYPO3 {
.closest(AdminPanelSelectors.contentParentClass) .closest(AdminPanelSelectors.contentParentClass)
.querySelector(AdminPanelSelectors.contentSettingsParentClass); .querySelector(AdminPanelSelectors.contentSettingsParentClass);
return new AdminPanelContentSetting(contentSettingElement, contentSettingTrigger); return new AdminPanelContentSetting(contentSettingElement, contentSettingTrigger);
} },
); );
this.trigger = document.querySelector(AdminPanelSelectors.triggerRole) as HTMLElement; this.trigger = document.querySelector(AdminPanelSelectors.triggerRole) as HTMLElement;
...@@ -356,6 +356,6 @@ namespace TYPO3 { ...@@ -356,6 +356,6 @@ namespace TYPO3 {
window.addEventListener( window.addEventListener(
'load', 'load',
() => new TYPO3.AdminPanel(), () => new TYPO3.AdminPanel(),
false false,
); );
})(); })();
...@@ -24,6 +24,6 @@ namespace TYPO3 { ...@@ -24,6 +24,6 @@ namespace TYPO3 {
window.addEventListener( window.addEventListener(
'load', 'load',
() => new TYPO3.Cache(), () => new TYPO3.Cache(),
false false,
); );
})(); })();
...@@ -50,6 +50,6 @@ namespace TYPO3 { ...@@ -50,6 +50,6 @@ namespace TYPO3 {
window.addEventListener( window.addEventListener(
'load', 'load',
() => new TYPO3.Preview(), () => new TYPO3.Preview(),
false false,
); );
})(); })();
...@@ -23,7 +23,7 @@ import Viewport = require('./Viewport'); ...@@ -23,7 +23,7 @@ import Viewport = require('./Viewport');
enum Identifiers { enum Identifiers {
hide = '.t3js-record-hide', hide = '.t3js-record-hide',
delete = '.t3js-record-delete', delete = '.t3js-record-delete',
icon = '.t3js-icon' icon = '.t3js-icon',
} }
/** /**
...@@ -95,13 +95,13 @@ class AjaxDataHandler { ...@@ -95,13 +95,13 @@ class AjaxDataHandler {
text: $anchorElement.data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel', text: $anchorElement.data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel',
active: true, active: true,
btnClass: 'btn-default', btnClass: 'btn-default',
name: 'cancel' name: 'cancel',
}, },
{ {
text: $anchorElement.data('button-ok-text') || TYPO3.lang['button.delete'] || 'Delete', text: $anchorElement.data('button-ok-text') || TYPO3.lang['button.delete'] || 'Delete',
btnClass: 'btn-warning', btnClass: 'btn-warning',
name: 'delete' name: 'delete',
} },
]); ]);
$modal.on('button.clicked', (e: JQueryEventObject): void => { $modal.on('button.clicked', (e: JQueryEventObject): void => {
if (e.target.getAttribute('name') === 'cancel') { if (e.target.getAttribute('name') === 'cancel') {
......
...@@ -78,7 +78,7 @@ class ContextHelp { ...@@ -78,7 +78,7 @@ class ContextHelp {
if (typeof description !== 'undefined' && description !== '') { if (typeof description !== 'undefined' && description !== '') {
Popover.setOptions($me, { Popover.setOptions($me, {
title: $me.data('title'), title: $me.data('title'),
content: description content: description,
}); });
} else if ($me.attr('data-loaded') === 'false' && $me.data('table')) { } else if ($me.attr('data-loaded') === 'false' && $me.data('table')) {
this.loadHelp($me); this.loadHelp($me);
...@@ -127,7 +127,7 @@ class ContextHelp { ...@@ -127,7 +127,7 @@ class ContextHelp {
'&table=' + $trigger.data('table') + '&table=' + $trigger.data('table') +
'&field=' + $trigger.data('field'), '&field=' + $trigger.data('field'),
'ContextHelpWindow', 'ContextHelpWindow',
'height=400,width=600,status=0,menubar=0,scrollbars=1' 'height=400,width=600,status=0,menubar=0,scrollbars=1',
); );
cshWindow.focus(); cshWindow.focus();
Popover.hide($trigger); Popover.hide($trigger);
...@@ -152,14 +152,14 @@ class ContextHelp { ...@@ -152,14 +152,14 @@ class ContextHelp {
params: { params: {
action: 'getContextHelp', action: 'getContextHelp',
table: table, table: table,
field: field field: field,
} },
}).done((data: HelpData): void => { }).done((data: HelpData): void => {
const title = data.title || ''; const title = data.title || '';
const content = data.content || '<p></p>'; const content = data.content || '<p></p>';
Popover.setOptions($trigger, { Popover.setOptions($trigger, {
title: title, title: title,
content: content content: content,
}); });
$trigger $trigger
.attr('data-loaded', 'true') .attr('data-loaded', 'true')
......
...@@ -110,7 +110,7 @@ class ContextMenu { ...@@ -110,7 +110,7 @@ class ContextMenu {
$me.data('uid'), $me.data('uid'),
$me.data('context'), $me.data('context'),
$me.data('iteminfo'), $me.data('iteminfo'),
$me.data('parameters') $me.data('parameters'),
); );
}); });
...@@ -225,18 +225,18 @@ class ContextMenu { ...@@ -225,18 +225,18 @@ class ContextMenu {
let y = this.mousePos.Y; let y = this.mousePos.Y;
const dimsWindow = { const dimsWindow = {
width: $(window).width() - 20, // saving margin for scrollbars width: $(window).width() - 20, // saving margin for scrollbars
height: $(window).height() height: $(window).height(),
}; };
// dimensions for the context menu // dimensions for the context menu
const dims = { const dims = {
width: $obj.width(), width: $obj.width(),
height: $obj.height() height: $obj.height(),
}; };
const relative = { const relative = {
X: this.mousePos.X - $(document).scrollLeft(), X: this.mousePos.X - $(document).scrollLeft(),
Y: this.mousePos.Y - $(document).scrollTop() Y: this.mousePos.Y - $(document).scrollTop(),
}; };
// adjusting the Y position of the layer to fit it into the window frame // adjusting the Y position of the layer to fit it into the window frame
...@@ -336,7 +336,7 @@ class ContextMenu { ...@@ -336,7 +336,7 @@ class ContextMenu {
$(obj).hide(); $(obj).hide();
} }
}, },
500 500,
); );
} }
......
...@@ -46,7 +46,7 @@ class ContextMenuActions { ...@@ -46,7 +46,7 @@ class ContextMenuActions {
top.TYPO3.settings.FormEngine.moduleUrl top.TYPO3.settings.FormEngine.moduleUrl
+ '&edit[' + table + '][' + uid + ']=edit' + '&edit[' + table + '][' + uid + ']=edit'
+ overrideVals + overrideVals
+ '&returnUrl=' + ContextMenuActions.getReturnUrl() + '&returnUrl=' + ContextMenuActions.getReturnUrl(),
); );
} }
...@@ -86,7 +86,7 @@ class ContextMenuActions { ...@@ -86,7 +86,7 @@ class ContextMenuActions {
*/ */
public static newPageWizard(table: string, uid: number): void { public static newPageWizard(table: string, uid: number): void {
Viewport.ContentContainer.setUrl( Viewport.ContentContainer.setUrl(
top.TYPO3.settings.NewRecord.moduleUrl + '&id=' + uid + '&pagesOnly=1&returnUrl=' + ContextMenuActions.getReturnUrl() top.TYPO3.settings.NewRecord.moduleUrl + '&id=' + uid + '&pagesOnly=1&returnUrl=' + ContextMenuActions.getReturnUrl(),
); );
} }
...@@ -104,7 +104,7 @@ class ContextMenuActions { ...@@ -104,7 +104,7 @@ class ContextMenuActions {
type: Modal.types.ajax, type: Modal.types.ajax,
size: Modal.sizes.medium, size: Modal.sizes.medium,
content: $wizardUrl, content: $wizardUrl,
severity: SeverityEnum.notice severity: SeverityEnum.notice,
}); });
} }
} }
...@@ -115,7 +115,7 @@ class ContextMenuActions { ...@@ -115,7 +115,7 @@ class ContextMenuActions {
*/ */
public static newRecord(table: string, uid: number): void { public static newRecord(table: string, uid: number): void {
Viewport.ContentContainer.setUrl( Viewport.ContentContainer.setUrl(
top.TYPO3.settings.FormEngine.moduleUrl + '&edit[' + table + '][-' + uid + ']=new&returnUrl=' + ContextMenuActions.getReturnUrl() top.TYPO3.settings.FormEngine.moduleUrl + '&edit[' + table + '][-' + uid + ']=new&returnUrl=' + ContextMenuActions.getReturnUrl(),
); );
} }
...@@ -125,7 +125,7 @@ class ContextMenuActions { ...@@ -125,7 +125,7 @@ class ContextMenuActions {
*/ */
public static openHistoryPopUp(table: string, uid: number): void { public static openHistoryPopUp(table: string, uid: number): void {
Viewport.ContentContainer.setUrl( Viewport.ContentContainer.setUrl(
top.TYPO3.settings.RecordHistory.moduleUrl + '&element=' + table + ':' + uid + '&returnUrl=' + ContextMenuActions.getReturnUrl() top.TYPO3.settings.RecordHistory.moduleUrl + '&element=' + table + ':' + uid + '&returnUrl=' + ContextMenuActions.getReturnUrl(),
); );
} }
...@@ -168,7 +168,7 @@ class ContextMenuActions { ...@@ -168,7 +168,7 @@ class ContextMenuActions {
Viewport.ContentContainer.setUrl( Viewport.ContentContainer.setUrl(
top.TYPO3.settings.RecordCommit.moduleUrl top.TYPO3.settings.RecordCommit.moduleUrl
+ '&data[' + table + '][' + uid + '][hidden]=1' + '&data[' + table + '][' + uid + '][hidden]=1'
+ '&redirect=' + ContextMenuActions.getReturnUrl() + '&redirect=' + ContextMenuActions.getReturnUrl(),
).done((): void => { ).done((): void => {
Viewport.NavigationContainer.PageTree.refreshTree(); Viewport.NavigationContainer.PageTree.refreshTree();
}); });
...@@ -182,7 +182,7 @@ class ContextMenuActions { ...@@ -182,7 +182,7 @@ class ContextMenuActions {
Viewport.ContentContainer.setUrl( Viewport.ContentContainer.setUrl(
top.TYPO3.settings.RecordCommit.moduleUrl top.TYPO3.settings.RecordCommit.moduleUrl
+ '&data[' + table + '][' + uid + '][hidden]=0' + '&data[' + table + '][' + uid + '][hidden]=0'
+ '&redirect=' + ContextMenuActions.getReturnUrl() + '&redirect=' + ContextMenuActions.getReturnUrl(),
).done((): void => { ).done((): void => {
Viewport.NavigationContainer.PageTree.refreshTree(); Viewport.NavigationContainer.PageTree.refreshTree();
}); });
...@@ -202,13 +202,13 @@ class ContextMenuActions { ...@@ -202,13 +202,13 @@ class ContextMenuActions {
text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel', text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel',
active: true, active: true,
btnClass: 'btn-default', btnClass: 'btn-default',
name: 'cancel' name: 'cancel',
}, },
{ {
text: $(this).data('button-ok-text') || TYPO3.lang['button.delete'] || 'Delete', text: $(this).data('button-ok-text') || TYPO3.lang['button.delete'] || 'Delete',
btnClass: 'btn-warning', btnClass: 'btn-warning',
name: 'delete' name: 'delete',
} },
]); ]);
$modal.on('button.clicked', (e: JQueryEventObject): void => { $modal.on('button.clicked', (e: JQueryEventObject): void => {
...@@ -216,7 +216,7 @@ class ContextMenuActions { ...@@ -216,7 +216,7 @@ class ContextMenuActions {
Viewport.ContentContainer.setUrl( Viewport.ContentContainer.setUrl(
top.TYPO3.settings.RecordCommit.moduleUrl top.TYPO3.settings.RecordCommit.moduleUrl
+ '&redirect=' + ContextMenuActions.getReturnUrl() + '&redirect=' + ContextMenuActions.getReturnUrl()
+ '&cmd[' + table + '][' + uid + '][delete]=1' + '&cmd[' + table + '][' + uid + '][delete]=1',
).done((): void => { ).done((): void => {
if (table === 'pages' && Viewport.NavigationContainer.PageTree) { if (table === 'pages' && Viewport.NavigationContainer.PageTree) {
if (uid === top.fsMod.recentIds.web) { if (uid === top.fsMod.recentIds.web) {
...@@ -318,7 +318,7 @@ class ContextMenuActions { ...@@ -318,7 +318,7 @@ class ContextMenuActions {
+ '&redirect=' + ContextMenuActions.getReturnUrl(); + '&redirect=' + ContextMenuActions.getReturnUrl();
Viewport.ContentContainer.setUrl( Viewport.ContentContainer.setUrl(
top.TYPO3.settings.RecordCommit.moduleUrl + url top.TYPO3.settings.RecordCommit.moduleUrl + url,
).done((): void => { ).done((): void => {
if (table === 'pages' && Viewport.NavigationContainer.PageTree) { if (table === 'pages' && Viewport.NavigationContainer.PageTree) {
Viewport.NavigationContainer.PageTree.refreshTree(); Viewport.NavigationContainer.PageTree.refreshTree();
...@@ -337,13 +337,13 @@ class ContextMenuActions { ...@@ -337,13 +337,13 @@ class ContextMenuActions {
text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel', text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel',
active: true, active: true,
btnClass: 'btn-default', btnClass: 'btn-default',
name: 'cancel' name: 'cancel',
}, },
{ {
text: $(this).data('button-ok-text') || TYPO3.lang['button.ok'] || 'OK', text: $(this).data('button-ok-text') || TYPO3.lang['button.ok'] || 'OK',
btnClass: 'btn-warning', btnClass: 'btn-warning',
name: 'ok' name: 'ok',
} },
]); ]);
$modal.on('button.clicked', (e: JQueryEventObject): void => { $modal.on('button.clicked', (e: JQueryEventObject): void => {
......
...@@ -132,8 +132,8 @@ class DateTimePicker { ...@@ -132,8 +132,8 @@ class DateTimePicker {
previous: 'fa fa-chevron-left', previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right', next: 'fa fa-chevron-right',
today: 'fa fa-calendar-o', today: 'fa fa-calendar-o',
clear: 'fa fa-trash' clear: 'fa fa-trash',
} },
}; };
// set options based on type // set options based on type
......
...@@ -80,18 +80,18 @@ class DebugConsole { ...@@ -80,18 +80,18 @@ class DebugConsole {
'aria-controls': tabIdentifier, 'aria-controls': tabIdentifier,
'data-toggle': 'tab', 'data-toggle': 'tab',
href: '#' + tabIdentifier, href: '#' + tabIdentifier,
role: 'tab' role: 'tab',
}).text(group + ' ').append( }).text(group + ' ').append(
$('<span />', {'class': 'badge'}) $('<span />', {'class': 'badge'}),
) ),
).on('shown.bs.tab', (e: Event) => { ).on('shown.bs.tab', (e: Event) => {
$(e.currentTarget).find('.badge').text(''); $(e.currentTarget).find('.badge').text('');
}); });
$debugTabs.append($tab); $debugTabs.append($tab);
$tabContent.append( $tabContent.append(
$('<div />', {role: 'tabpanel', 'class': 'tab-pane', id: tabIdentifier}).append( $('<div />', {role: 'tabpanel', 'class': 'tab-pane', id: tabIdentifier}).append(
$('<div />', {'class': 't3js-messages messages'}) $('<div />', {'class': 't3js-messages messages'}),
) ),
);