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 @@
"forin": true,
"indent": [
true,
"spaces",
2
],
"interface-name": false,
......@@ -28,9 +29,20 @@
],
"member-ordering": [
true,
"public-before-private",
"static-before-instance",
"variables-before-functions"
{
"order": [
"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-arg": true,
......@@ -52,10 +64,12 @@
"no-require-imports": false,
"no-string-literal": true,
"no-switch-case-fall-through": true,
"trailing-comma": {
"singleline": "never",
"multiline": "always"
},
"trailing-comma": [
true, {
"multiline": "always",
"singleline": "never"
}
],
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-var-keyword": true,
......
......@@ -41,7 +41,7 @@ declare namespace TYPO3 {
label: string,
title: string,
exclusiveValues?: string,
$optionEl?: JQuery
$optionEl?: JQuery,
): void;
public reinitialize(): void;
}
......@@ -84,7 +84,7 @@ interface Window {
$: any;
startInModule: Array<string>;
inline: {
delayedImportElement: (objectId: number, table: string, uid: number, type: string) => void
delayedImportElement: (objectId: number, table: string, uid: number, type: string) => void,
};
rawurlencode: Function;
list_frame: Window;
......
......@@ -15,7 +15,7 @@ namespace TYPO3 {
zoomTarget: '[data-typo3-zoom-target]',
zoomClose: '[data-typo3-zoom-close]',
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 = {
......@@ -26,7 +26,7 @@ namespace TYPO3 {
activeTab: 'typo3-adminPanel-content-header-item-active',
activePane: 'typo3-adminPanel-content-panes-item-active',
noScroll: 'typo3-adminPanel-noscroll',
zoomShow: 'typo3-adminPanel-zoom-show'
zoomShow: 'typo3-adminPanel-zoom-show',
};
export class AdminPanel {
......@@ -43,16 +43,16 @@ namespace TYPO3 {
(moduleTrigger: HTMLElement) => {
const moduleParent = moduleTrigger.closest(AdminPanelSelectors.moduleParentClass);
return new AdminPanelModule(this, moduleParent, moduleTrigger);
}
},
);
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(
(panelTrigger: HTMLElement) => {
const panelParent = panelTrigger.closest(AdminPanelSelectors.panelParentClass);
return new AdminPanelPanel(panelParent, panelTrigger);
}
},
);
this.contentSettings = this.querySelectorAll(AdminPanelSelectors.contentSettingsTriggerRole).map(
(contentSettingTrigger: HTMLElement) => {
......@@ -60,7 +60,7 @@ namespace TYPO3 {
.closest(AdminPanelSelectors.contentParentClass)
.querySelector(AdminPanelSelectors.contentSettingsParentClass);
return new AdminPanelContentSetting(contentSettingElement, contentSettingTrigger);
}
},
);
this.trigger = document.querySelector(AdminPanelSelectors.triggerRole) as HTMLElement;
......@@ -356,6 +356,6 @@ namespace TYPO3 {
window.addEventListener(
'load',
() => new TYPO3.AdminPanel(),
false
false,
);
})();
......@@ -24,6 +24,6 @@ namespace TYPO3 {
window.addEventListener(
'load',
() => new TYPO3.Cache(),
false
false,
);
})();
......@@ -50,6 +50,6 @@ namespace TYPO3 {
window.addEventListener(
'load',
() => new TYPO3.Preview(),
false
false,
);
})();
......@@ -23,7 +23,7 @@ import Viewport = require('./Viewport');
enum Identifiers {
hide = '.t3js-record-hide',
delete = '.t3js-record-delete',
icon = '.t3js-icon'
icon = '.t3js-icon',
}
/**
......@@ -95,13 +95,13 @@ class AjaxDataHandler {
text: $anchorElement.data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel',
active: true,
btnClass: 'btn-default',
name: 'cancel'
name: 'cancel',
},
{
text: $anchorElement.data('button-ok-text') || TYPO3.lang['button.delete'] || 'Delete',
btnClass: 'btn-warning',
name: 'delete'
}
name: 'delete',
},
]);
$modal.on('button.clicked', (e: JQueryEventObject): void => {
if (e.target.getAttribute('name') === 'cancel') {
......
......@@ -78,7 +78,7 @@ class ContextHelp {
if (typeof description !== 'undefined' && description !== '') {
Popover.setOptions($me, {
title: $me.data('title'),
content: description
content: description,
});
} else if ($me.attr('data-loaded') === 'false' && $me.data('table')) {
this.loadHelp($me);
......@@ -127,7 +127,7 @@ class ContextHelp {
'&table=' + $trigger.data('table') +
'&field=' + $trigger.data('field'),
'ContextHelpWindow',
'height=400,width=600,status=0,menubar=0,scrollbars=1'
'height=400,width=600,status=0,menubar=0,scrollbars=1',
);
cshWindow.focus();
Popover.hide($trigger);
......@@ -152,14 +152,14 @@ class ContextHelp {
params: {
action: 'getContextHelp',
table: table,
field: field
}
field: field,
},
}).done((data: HelpData): void => {
const title = data.title || '';
const content = data.content || '<p></p>';
Popover.setOptions($trigger, {
title: title,
content: content
content: content,
});
$trigger
.attr('data-loaded', 'true')
......
......@@ -110,7 +110,7 @@ class ContextMenu {
$me.data('uid'),
$me.data('context'),
$me.data('iteminfo'),
$me.data('parameters')
$me.data('parameters'),
);
});
......@@ -225,18 +225,18 @@ class ContextMenu {
let y = this.mousePos.Y;
const dimsWindow = {
width: $(window).width() - 20, // saving margin for scrollbars
height: $(window).height()
height: $(window).height(),
};
// dimensions for the context menu
const dims = {
width: $obj.width(),
height: $obj.height()
height: $obj.height(),
};
const relative = {
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
......@@ -336,7 +336,7 @@ class ContextMenu {
$(obj).hide();
}
},
500
500,
);
}
......
......@@ -46,7 +46,7 @@ class ContextMenuActions {
top.TYPO3.settings.FormEngine.moduleUrl
+ '&edit[' + table + '][' + uid + ']=edit'
+ overrideVals
+ '&returnUrl=' + ContextMenuActions.getReturnUrl()
+ '&returnUrl=' + ContextMenuActions.getReturnUrl(),
);
}
......@@ -86,7 +86,7 @@ class ContextMenuActions {
*/
public static newPageWizard(table: string, uid: number): void {
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 {
type: Modal.types.ajax,
size: Modal.sizes.medium,
content: $wizardUrl,
severity: SeverityEnum.notice
severity: SeverityEnum.notice,
});
}
}
......@@ -115,7 +115,7 @@ class ContextMenuActions {
*/
public static newRecord(table: string, uid: number): void {
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 {
*/
public static openHistoryPopUp(table: string, uid: number): void {
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 {
Viewport.ContentContainer.setUrl(
top.TYPO3.settings.RecordCommit.moduleUrl
+ '&data[' + table + '][' + uid + '][hidden]=1'
+ '&redirect=' + ContextMenuActions.getReturnUrl()
+ '&redirect=' + ContextMenuActions.getReturnUrl(),
).done((): void => {
Viewport.NavigationContainer.PageTree.refreshTree();
});
......@@ -182,7 +182,7 @@ class ContextMenuActions {
Viewport.ContentContainer.setUrl(
top.TYPO3.settings.RecordCommit.moduleUrl
+ '&data[' + table + '][' + uid + '][hidden]=0'
+ '&redirect=' + ContextMenuActions.getReturnUrl()
+ '&redirect=' + ContextMenuActions.getReturnUrl(),
).done((): void => {
Viewport.NavigationContainer.PageTree.refreshTree();
});
......@@ -202,13 +202,13 @@ class ContextMenuActions {
text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel',
active: true,
btnClass: 'btn-default',
name: 'cancel'
name: 'cancel',
},
{
text: $(this).data('button-ok-text') || TYPO3.lang['button.delete'] || 'Delete',
btnClass: 'btn-warning',
name: 'delete'
}
name: 'delete',
},
]);
$modal.on('button.clicked', (e: JQueryEventObject): void => {
......@@ -216,7 +216,7 @@ class ContextMenuActions {
Viewport.ContentContainer.setUrl(
top.TYPO3.settings.RecordCommit.moduleUrl
+ '&redirect=' + ContextMenuActions.getReturnUrl()
+ '&cmd[' + table + '][' + uid + '][delete]=1'
+ '&cmd[' + table + '][' + uid + '][delete]=1',
).done((): void => {
if (table === 'pages' && Viewport.NavigationContainer.PageTree) {
if (uid === top.fsMod.recentIds.web) {
......@@ -318,7 +318,7 @@ class ContextMenuActions {
+ '&redirect=' + ContextMenuActions.getReturnUrl();
Viewport.ContentContainer.setUrl(
top.TYPO3.settings.RecordCommit.moduleUrl + url
top.TYPO3.settings.RecordCommit.moduleUrl + url,
).done((): void => {
if (table === 'pages' && Viewport.NavigationContainer.PageTree) {
Viewport.NavigationContainer.PageTree.refreshTree();
......@@ -337,13 +337,13 @@ class ContextMenuActions {
text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel',
active: true,
btnClass: 'btn-default',
name: 'cancel'
name: 'cancel',
},
{
text: $(this).data('button-ok-text') || TYPO3.lang['button.ok'] || 'OK',
btnClass: 'btn-warning',
name: 'ok'
}
name: 'ok',
},
]);
$modal.on('button.clicked', (e: JQueryEventObject): void => {
......
......@@ -132,8 +132,8 @@ class DateTimePicker {
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'fa fa-calendar-o',
clear: 'fa fa-trash'
}
clear: 'fa fa-trash',
},
};
// set options based on type
......
......@@ -80,18 +80,18 @@ class DebugConsole {
'aria-controls': tabIdentifier,
'data-toggle': 'tab',
href: '#' + tabIdentifier,
role: 'tab'
role: 'tab',
}).text(group + ' ').append(
$('<span />', {'class': 'badge'})
)
$('<span />', {'class': 'badge'}),
),
).on('shown.bs.tab', (e: Event) => {
$(e.currentTarget).find('.badge').text('');
});
$debugTabs.append($tab);
$tabContent.append(
$('<div />', {role: 'tabpanel', 'class': 'tab-pane', id: tabIdentifier}).append(
$('<div />', {'class': 't3js-messages messages'})
)
$('<div />', {'class': 't3js-messages messages'}),
),
);
}
......@@ -121,33 +121,33 @@ class DebugConsole {
$('<div />', {id: 'typo3-debug-console'}).append(
$('<div />', {'class': 't3js-topbar topbar'}).append(
$('<p />', {'class': 'pull-left'}).text(' TYPO3 Debug Console').prepend(
$('<span />', {'class': 'fa fa-terminal topbar-icon'})
$('<span />', {'class': 'fa fa-terminal topbar-icon'}),
).append(
$('<span />', {'class': 'badge'})
$('<span />', {'class': 'badge'}),
),
$('<div />', {'class': 't3js-buttons btn-group pull-right'})
$('<div />', {'class': 't3js-buttons btn-group pull-right'}),
),
$('<div />').append(
$('<div />', {role: 'tabpanel'}).append(
$('<ul />', {'class': 'nav nav-tabs t3js-debuggroups', role: 'tablist'})
$('<ul />', {'class': 'nav nav-tabs t3js-debuggroups', role: 'tablist'}),
),
$('<div />', {'class': 'tab-content t3js-debugcontent'})
)
$('<div />', {'class': 'tab-content t3js-debugcontent'}),
),
);
this.addButton(
$('<button />', {
'class': 'btn btn-default btn-sm ' + (this.settings.autoscroll ? 'active' : ''),
title: TYPO3.lang['debuggerconsole.autoscroll']
title: TYPO3.lang['debuggerconsole.autoscroll'],
}).append($('<span />', {'class': 't3-icon fa fa-magnet'})),
(): void => {
$(this).button('toggle');
this.settings.autoscroll = !this.settings.autoscroll;
}
},
).addButton(
$('<button />', {
'class': 'btn btn-default btn-sm',
title: TYPO3.lang['debuggerconsole.toggle.collapse']
title: TYPO3.lang['debuggerconsole.toggle.collapse'],
}).append($('<span />', {'class': 't3-icon fa fa-chevron-down'})),
(e: Event): void => {
let $button = $(e.currentTarget);
......@@ -162,14 +162,14 @@ class DebugConsole {
$button.attr('title', TYPO3.lang['debuggerconsole.toggle.expand']);
$icon.toggleClass('fa-chevron-down', false).toggleClass('fa-chevron-up', true);
}
}
},
).addButton(
$('<button />', {
'class': 'btn btn-default btn-sm',
title: TYPO3.lang['debuggerconsole.clear']}).append($('<span />', {class: 't3-icon fa fa-undo'})),
(): void => {
this.flush();
}
},
).addButton(
$('<button />', {
'class': 'btn btn-default btn-sm',
......@@ -177,7 +177,7 @@ class DebugConsole {
(): void => {
this.destroy();
this.createDom();
}
},
);
}
......
......@@ -37,9 +37,9 @@ class DocumentHeader {
moduleNavigationBar: '.t3js-module-docheader-bar-navigation',
moduleButtonBar: '.t3js-module-docheader-bar-buttons',
moduleSearchBar: '.t3js-module-docheader-bar-search',
moduleBody: '.t3js-module-body'
moduleBody: '.t3js-module-body',
}
},
};
constructor() {
......
......@@ -32,7 +32,7 @@ enum Action {
OVERRIDE = 'replace',
RENAME = 'rename',
SKIP = 'cancel',
USE_EXISTING = 'useExisting'
USE_EXISTING = 'useExisting',
}
/**
......@@ -126,7 +126,7 @@ class DragUploaderPlugin {
this.browserCapabilities = {
fileReader: typeof FileReader !== 'undefined',
DnD: 'draggable' in document.createElement('span'),
Progress: 'upload' in new XMLHttpRequest
Progress: 'upload' in new XMLHttpRequest,
};
......@@ -157,7 +157,7 @@ class DragUploaderPlugin {
TYPO3.lang['file_upload.dropzonehint.message'] +
'</p>' +
'</div>' +
'</div>'
'</div>',
).click(() => {
this.fileInput.click();
});
......@@ -257,7 +257,7 @@ class DragUploaderPlugin {
url: TYPO3.settings.ajaxUrls.file_exists,
data: {
fileName: file.name,
fileTarget: this.target
fileTarget: this.target,
},
cache: false,
success: (response: any) => {
......@@ -266,14 +266,14 @@ class DragUploaderPlugin {
this.askForOverride.push({
original: response,
uploaded: file,
action: this.irreObjectUid ? Action.USE_EXISTING : Action.SKIP
action: this.irreObjectUid ? Action.USE_EXISTING : Action.SKIP,
});
NProgress.inc(this.percentagePerFile);
} else {
// Unused var _ is necessary as "no-unused-expression" is active
const _ = new FileQueueItem(this, file, Action.SKIP);
}
}
},
});
});
......@@ -320,7 +320,7 @@ class DragUploaderPlugin {
$.each(data, (index: number, flashMessage: { title: string, message: string, severity: number }) => {
Notification.showMessage(flashMessage.title, flashMessage.message, flashMessage.severity);
});
}
},
});
}
}
......@@ -342,10 +342,10 @@ class DragUploaderPlugin {
$('<th/>'),
$('<th/>').text(TYPO3.lang['file_upload.header.originalFile']),
$('<th/>').text(TYPO3.lang['file_upload.header.uploadedFile']),
$('<th/>').text(TYPO3.lang['file_upload.header.action'])
)
)
)
$('<th/>').text(TYPO3.lang['file_upload.header.action']),
),
),
),
);
for (let i = 0; i < amountOfItems; ++i) {
......@@ -354,24 +354,24 @@ class DragUploaderPlugin {
(this.askForOverride[i].original.thumbUrl !== ''
? $('<img />', {src: this.askForOverride[i].original.thumbUrl, height: 40})
: $(this.askForOverride[i].original.icon)
)
),
),
$('<td />').html(
this.askForOverride[i].original.name + ' (' + (DragUploader.fileSizeAsString(this.askForOverride[i].original.size)) + ')' +
'<br>' + moment(this.askForOverride[i].original.mtime, 'x').format('YYYY-MM-DD HH:mm')
'<br>' + moment(this.askForOverride[i].original.mtime, 'x').format('YYYY-MM-DD HH:mm'),
),
$('<td />').html(
this.askForOverride[i].uploaded.name + ' (' + (DragUploader.fileSizeAsString(this.askForOverride[i].uploaded.size)) + ')' +
'<br>' + moment(this.askForOverride[i].uploaded.lastModifiedDate, 'X').format('YYYY-MM-DD HH:mm')
'<br>' + moment(this.askForOverride[i].uploaded.lastModifiedDate, 'X').format('YYYY-MM-DD HH:mm'),
),
$('<td />').append(
$('<select />', {class: 'form-control t3js-actions', 'data-override': i}).append(
(this.irreObjectUid ? $('<option/>').val(Action.USE_EXISTING).text(TYPO3.lang['file_upload.actions.use_existing']) : ''),
$('<option />').val(Action.SKIP).text(TYPO3.lang['file_upload.actions.skip']),
$('<option />').val(Action.RENAME).text(TYPO3.lang['file_upload.actions.rename']),
$('<option />').val(Action.OVERRIDE).text(TYPO3.lang['file_upload.actions.override'])
)
)
$('<option />').val(Action.OVERRIDE).text(TYPO3.lang['file_upload.actions.override']),
),
),