mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-7100] ESLint support for ADF Core and DemoShell projects (#7481)
* remove tsconfig.base as per eslint schematics * add schematics * upgrade demoshell to eslint * fix eslint issues for demoshell * integrate eslint for ADF core and fix some issues * turn into warn * fix code * workaround for Chrome clipboard issue * exclude e2e tests * exclude e2e
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* tslint:disable:no-input-rename */
|
||||
/* eslint-disable @angular-eslint/no-input-rename */
|
||||
|
||||
import { ChangeDetectorRef, Directive, ElementRef, Host, Inject, Input, OnChanges, Optional, Renderer2, SimpleChanges } from '@angular/core';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* tslint:disable:no-input-rename */
|
||||
/* eslint-disable @angular-eslint/no-input-rename */
|
||||
|
||||
import { Directive, ElementRef, Input, Renderer2, AfterViewChecked } from '@angular/core';
|
||||
import { HighlightTransformService, HighlightTransformResult } from '../services/highlight-transform.service';
|
||||
|
@@ -34,7 +34,7 @@ export class LibraryFavoriteDirective implements OnChanges {
|
||||
library: LibraryEntity = null;
|
||||
|
||||
@Output() toggle = new EventEmitter<any>();
|
||||
// tslint:disable-next-line: no-output-native
|
||||
// eslint-disable-next-line @angular-eslint/no-output-native
|
||||
@Output() error = new EventEmitter<any>();
|
||||
|
||||
private targetLibrary = null;
|
||||
|
@@ -149,7 +149,7 @@ describe('LibraryMembershipDirective', () => {
|
||||
expect(deleteMembershipSpy).not.toHaveBeenCalled();
|
||||
}));
|
||||
|
||||
it("should add 'workspace' to send appropriate email", fakeAsync(() => {
|
||||
it(`should add 'workspace' to send appropriate email`, fakeAsync(() => {
|
||||
mockSupportedVersion = true;
|
||||
const selection = { entry: { id: 'no-membership-requested' } };
|
||||
const change = new SimpleChange(null, selection, true);
|
||||
|
@@ -65,7 +65,7 @@ export class LibraryMembershipDirective implements OnChanges {
|
||||
@Output()
|
||||
toggle = new EventEmitter<LibraryMembershipToggleEvent>();
|
||||
|
||||
// tslint:disable-next-line: no-output-native
|
||||
// eslint-disable-next-line @angular-eslint/no-output-native
|
||||
@Output()
|
||||
error = new EventEmitter<LibraryMembershipErrorEvent>();
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* tslint:disable:no-input-rename */
|
||||
/* eslint-disable @angular-eslint/no-input-rename */
|
||||
|
||||
import { Directive, ElementRef, EventEmitter, HostListener, Input, OnChanges, Output } from '@angular/core';
|
||||
import { NodeEntry, Node, DeletedNodeEntity, DeletedNode, TrashcanApi, NodesApi } from '@alfresco/js-api';
|
||||
@@ -185,6 +185,7 @@ export class NodeDeleteDirective implements OnChanges {
|
||||
if (status.allFailed && !status.oneFailed) {
|
||||
return this.translation.instant(
|
||||
'CORE.DELETE_NODE.ERROR_PLURAL',
|
||||
// eslint-disable-next-line id-blacklist
|
||||
{ number: status.failed.length }
|
||||
);
|
||||
}
|
||||
@@ -192,6 +193,7 @@ export class NodeDeleteDirective implements OnChanges {
|
||||
if (status.allSucceeded && !status.oneSucceeded) {
|
||||
return this.translation.instant(
|
||||
'CORE.DELETE_NODE.PLURAL',
|
||||
// eslint-disable-next-line id-blacklist
|
||||
{ number: status.success.length }
|
||||
);
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ import { DownloadService } from '../services/download.service';
|
||||
* Directive selectors without adf- prefix will be deprecated on 3.0.0
|
||||
*/
|
||||
@Directive({
|
||||
// tslint:disable-next-line: directive-selector
|
||||
// eslint-disable-next-line @angular-eslint/directive-selector
|
||||
selector: '[adfNodeDownload]'
|
||||
})
|
||||
export class NodeDownloadDirective {
|
||||
@@ -110,7 +110,8 @@ export class NodeDownloadDirective {
|
||||
// nodeId for Shared node
|
||||
const id = (<any> node.entry).nodeId || node.entry.id;
|
||||
|
||||
let url, fileName;
|
||||
let url;
|
||||
let fileName;
|
||||
if (this.version) {
|
||||
url = this.contentApi.getVersionContentUrl(id, this.version.entry.id, true);
|
||||
fileName = this.version.entry.name;
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* tslint:disable:no-input-rename */
|
||||
/* eslint-disable @angular-eslint/no-input-rename */
|
||||
|
||||
import { Directive, EventEmitter, HostListener, Input, OnChanges, Output } from '@angular/core';
|
||||
import { FavoriteBody, NodeEntry, SharedLinkEntry, Node, SharedLink, FavoritesApi } from '@alfresco/js-api';
|
||||
|
@@ -69,7 +69,9 @@ describe('NodeRestoreDirective', () => {
|
||||
}));
|
||||
|
||||
translationService = TestBed.inject(TranslationService);
|
||||
spyOn(translationService, 'instant').and.callFake((key) => { return key; });
|
||||
spyOn(translationService, 'instant').and.callFake((key) => {
|
||||
return key;
|
||||
});
|
||||
});
|
||||
|
||||
it('should not restore when selection is empty', () => {
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* tslint:disable:component-selector no-input-rename */
|
||||
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/no-input-rename */
|
||||
|
||||
import { Directive, EventEmitter, HostListener, Input, Output } from '@angular/core';
|
||||
import { TrashcanApi, DeletedNodeEntry, DeletedNodesPaging, PathInfoEntity } from '@alfresco/js-api';
|
||||
@@ -194,6 +194,7 @@ export class NodeRestoreDirective {
|
||||
return this.translation.instant(
|
||||
'CORE.RESTORE_NODE.PARTIAL_PLURAL',
|
||||
{
|
||||
// eslint-disable-next-line id-blacklist
|
||||
number: status.fail.length
|
||||
}
|
||||
);
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* tslint:disable:no-input-rename */
|
||||
/* eslint-disable @angular-eslint/no-input-rename */
|
||||
|
||||
import { Directive, ElementRef, HostListener, Input, NgZone, OnDestroy, OnInit, Renderer2 } from '@angular/core';
|
||||
import { FileInfo, FileUtils } from '../utils/file-utils';
|
||||
|
Reference in New Issue
Block a user