mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
AAE-48934 Eslint v9 migration (#12110)
* update * update * update * working * cr * cr * update * use nx boundaries * fixes * fixes * fixes * cr * cr * update * update * update * cr * fix null * cr * cr * cr * cr * cr * update * update * update * update * update * remove some duplications * fix units
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
.storybook
|
||||
coverage
|
||||
@@ -1,106 +0,0 @@
|
||||
{
|
||||
"extends": ["../../.eslintrc.js"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": ["plugin:@nx/angular"],
|
||||
"parserOptions": {
|
||||
"project": ["lib/process-services-cloud/tsconfig.lib.json", "lib/process-services-cloud/tsconfig.spec.json", "lib/process-services-cloud/.storybook/tsconfig.json"],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"rules": {
|
||||
"jsdoc/tag-lines": [
|
||||
"error",
|
||||
"any",
|
||||
{
|
||||
"startLines": 1
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/naming-convention": "warn",
|
||||
"@typescript-eslint/consistent-type-assertions": "warn",
|
||||
"@typescript-eslint/prefer-for-of": "warn",
|
||||
"@typescript-eslint/member-ordering": "off",
|
||||
"no-underscore-dangle": [
|
||||
"error",
|
||||
{
|
||||
"allowAfterThis": true
|
||||
}
|
||||
],
|
||||
"no-shadow": "warn",
|
||||
"quote-props": "off",
|
||||
"object-shorthand": "warn",
|
||||
"prefer-const": "warn",
|
||||
"arrow-body-style": "warn",
|
||||
"@angular-eslint/no-output-native": "off",
|
||||
"space-before-function-paren": "off",
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": "adf-cloud",
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "attribute",
|
||||
"prefix": "adf-cloud",
|
||||
"style": "camelCase"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/no-input-prefix": "error",
|
||||
"@typescript-eslint/consistent-type-definitions": "error",
|
||||
"@typescript-eslint/dot-notation": "off",
|
||||
"@typescript-eslint/explicit-member-accessibility": [
|
||||
"off",
|
||||
{
|
||||
"accessibility": "explicit"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-inferrable-types": "off",
|
||||
"@typescript-eslint/no-require-imports": "off",
|
||||
"@typescript-eslint/no-var-requires": "error",
|
||||
"comma-dangle": "error",
|
||||
"default-case": "error",
|
||||
"import/order": "off",
|
||||
"max-len": [
|
||||
"error",
|
||||
{
|
||||
"code": 240
|
||||
}
|
||||
],
|
||||
"no-bitwise": "off",
|
||||
"no-duplicate-imports": "error",
|
||||
"no-multiple-empty-lines": "error",
|
||||
"no-return-await": "error",
|
||||
"rxjs/no-create": "error",
|
||||
"rxjs/no-subject-unsubscribe": "error",
|
||||
"rxjs/no-subject-value": "error",
|
||||
"rxjs/no-unsafe-takeuntil": "error",
|
||||
"unicorn/filename-case": "error",
|
||||
"@angular-eslint/prefer-standalone": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.spec.ts"],
|
||||
"plugins": ["@alfresco/eslint-angular"],
|
||||
"rules": {
|
||||
"@angular-eslint/component-class-suffix": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@nx/angular-template"],
|
||||
"parserOptions": {
|
||||
"project": ["lib/process-services-cloud/tsconfig.lib.json", "lib/process-services-cloud/tsconfig.spec.json"],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"rules": {
|
||||
"@angular-eslint/template/no-autofocus": "error",
|
||||
"@angular-eslint/template/no-positive-tabindex": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,24 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { dirname } from 'node:path';
|
||||
import type { StorybookConfig } from '@storybook/angular';
|
||||
// eslint-disable-next-line @nx/enforce-module-boundaries
|
||||
import rootMain from '../../../.storybook/main';
|
||||
|
||||
const config: StorybookConfig = {
|
||||
@@ -22,6 +40,12 @@ const config: StorybookConfig = {
|
||||
|
||||
export default config;
|
||||
|
||||
/**
|
||||
* Resolve absolute path for a package.
|
||||
*
|
||||
* @param value package name
|
||||
* @returns absolute path to the package
|
||||
*/
|
||||
function getAbsolutePath(value: string): any {
|
||||
return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
|
||||
}
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { type Preview } from '@storybook/angular';
|
||||
|
||||
const preview: Preview = {
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import rootConfig from '../../eslint.config.mjs';
|
||||
|
||||
export default [
|
||||
...rootConfig,
|
||||
{
|
||||
files: ['**/*.ts'],
|
||||
rules: {
|
||||
'@nx/enforce-module-boundaries': [
|
||||
'error',
|
||||
{
|
||||
enforceBuildableLibDependency: true,
|
||||
allow: [],
|
||||
depConstraints: [
|
||||
{
|
||||
sourceTag: 'scope:process-services-cloud',
|
||||
onlyDependOnLibsWithTags: ['scope:js-api', 'scope:core', 'scope:content-services', 'scope:extensions']
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/consistent-type-assertions': 'warn',
|
||||
'@typescript-eslint/prefer-for-of': 'warn',
|
||||
'no-underscore-dangle': [
|
||||
'error',
|
||||
{
|
||||
allowAfterThis: true
|
||||
}
|
||||
],
|
||||
'no-shadow': 'warn',
|
||||
'quote-props': 'off',
|
||||
'object-shorthand': 'warn',
|
||||
'prefer-const': 'warn',
|
||||
'arrow-body-style': 'warn',
|
||||
'space-before-function-paren': 'off',
|
||||
'@angular-eslint/component-selector': [
|
||||
'error',
|
||||
{
|
||||
type: 'element',
|
||||
prefix: 'adf-cloud',
|
||||
style: 'kebab-case'
|
||||
}
|
||||
],
|
||||
'@angular-eslint/directive-selector': [
|
||||
'error',
|
||||
{
|
||||
type: 'attribute',
|
||||
prefix: 'adf-cloud',
|
||||
style: 'camelCase'
|
||||
}
|
||||
],
|
||||
'@angular-eslint/prefer-standalone': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.spec.ts'],
|
||||
rules: {
|
||||
'@angular-eslint/component-class-suffix': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.html'],
|
||||
rules: {
|
||||
'@angular-eslint/template/no-autofocus': 'error',
|
||||
'@angular-eslint/template/no-positive-tabindex': 'error'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/.storybook/**/*.ts'],
|
||||
rules: {
|
||||
'@nx/enforce-module-boundaries': 'off'
|
||||
}
|
||||
}
|
||||
];
|
||||
@@ -4,6 +4,7 @@
|
||||
"sourceRoot": "lib/process-services-cloud/src",
|
||||
"projectType": "library",
|
||||
"prefix": "adf-cloud",
|
||||
"tags": ["scope:process-services-cloud", "type:library"],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@angular/build:ng-packagr",
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import { VersionCompatibilityService, AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import {
|
||||
ContentLinkModel,
|
||||
@@ -95,7 +93,6 @@ describe('FormCloudComponent', () => {
|
||||
template: '<div></div>',
|
||||
standalone: false
|
||||
})
|
||||
// eslint-disable-next-line @angular-eslint/component-class-suffix
|
||||
class CustomWidget {
|
||||
typeId = 'CustomWidget';
|
||||
}
|
||||
|
||||
-2
@@ -15,8 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { Component, EventEmitter, inject, OnDestroy, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
||||
import {
|
||||
FormValues,
|
||||
|
||||
-2
@@ -15,8 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { Component, EventEmitter, inject, Input, Output } from '@angular/core';
|
||||
import { LocalizedDatePipe, ThumbnailService, UploadDirective, DisplayableCMProperties, IconModule } from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { FormFieldMetadata } from '@alfresco/adf-core';
|
||||
import { FileSourceTypes, DestinationFolderPathType } from '../models/form-cloud-representation.model';
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable no-shadow */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
export class FormCloudRepresentation {
|
||||
id?: string;
|
||||
name?: string;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, EMPTY, of } from 'rxjs';
|
||||
import { IdentityGroupModel } from '../models/identity-group.model';
|
||||
import { IdentityGroupService } from '@alfresco/adf-process-services-cloud';
|
||||
import { IdentityGroupService } from '../services/identity-group.service';
|
||||
|
||||
export const mockVegetableAubergine: IdentityGroupModel = { id: 'aubergine', name: 'Vegetable Aubergine' };
|
||||
export const mockMeatChicken: IdentityGroupModel = { id: 'chicken', name: 'Meat Chicken' };
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
export const DateCloudFilterType = {
|
||||
NO_DATE: 'NO_DATE',
|
||||
TODAY: 'TODAY',
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, EMPTY, of } from 'rxjs';
|
||||
import { IdentityUserModel } from '../models/identity-user.model';
|
||||
import { IdentityUserService } from '@alfresco/adf-process-services-cloud';
|
||||
import { IdentityUserService } from '../services/identity-user.service';
|
||||
|
||||
export const mockYorkshirePudding: IdentityUserModel = {
|
||||
id: 'yorkshire',
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import { fakeProcessInstance, fakeProcessWithFormInstance, getFakeProcessPayload
|
||||
import { provideAppConfigTesting } from '@alfresco/adf-core';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { ProcessDefinitionCloud } from '@alfresco/adf-process-services-cloud';
|
||||
import { ProcessDefinitionCloud } from '../../../models/process-definition-cloud.model';
|
||||
|
||||
describe('StartProcessCloudService', () => {
|
||||
let service: StartProcessCloudService;
|
||||
|
||||
-1
@@ -19,7 +19,6 @@ import { DestroyRef, Directive, EventEmitter, inject, Input, Output } from '@ang
|
||||
import { FilterParamsModel } from '../models/filter-cloud.model';
|
||||
|
||||
@Directive()
|
||||
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
||||
export abstract class BaseTaskFiltersCloudComponent {
|
||||
/** Display filters available to the current user for the application with the specified name. */
|
||||
@Input()
|
||||
|
||||
-3
@@ -34,8 +34,6 @@ import { Environment } from '../../../../common/interface/environment.interface'
|
||||
import { isValid } from 'date-fns';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
export interface DropdownOption {
|
||||
value: string;
|
||||
label: string;
|
||||
@@ -54,7 +52,6 @@ const SORT_PROPERTY = 'sort';
|
||||
const ORDER_PROPERTY = 'order';
|
||||
|
||||
@Directive()
|
||||
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
||||
export abstract class BaseEditTaskFilterCloudComponent<T> implements OnChanges {
|
||||
public static ACTIONS_DISABLED_BY_DEFAULT = [ACTION_SAVE, ACTION_DELETE];
|
||||
|
||||
|
||||
-1
@@ -36,7 +36,6 @@ export class TaskFilterDialogCloudComponent implements OnInit {
|
||||
dialogRef = inject<MatDialogRef<TaskFilterDialogCloudComponent>>(MatDialogRef);
|
||||
data = inject(MAT_DIALOG_DATA);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
public static ACTION_SAVE = 'SAVE';
|
||||
defaultIcon = 'inbox';
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
*/
|
||||
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
/* eslint-disable no-shadow */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import { DateCloudFilterType } from '../../../models/date-cloud-filter.model';
|
||||
import { DateRangeFilterService } from '../../../common/date-range-filter/date-range-filter.service';
|
||||
|
||||
+1
-2
@@ -28,7 +28,7 @@ import { UserTaskCloudComponent } from './user-task-cloud.component';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TaskScreenCloudComponent } from '../../../../screen/components/screen-cloud/user-task-screen/screen-cloud.component';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { NoopAuthModule, NoopTranslateModule } from '@alfresco/adf-core';
|
||||
import { NoopAuthModule, NoopTranslateModule, FormModel } from '@alfresco/adf-core';
|
||||
import {
|
||||
TASK_ASSIGNED_STATE,
|
||||
TASK_CLAIM_PERMISSION,
|
||||
@@ -39,7 +39,6 @@ import {
|
||||
} from '../../../models/task-details-cloud.model';
|
||||
import { TaskFormCloudComponent } from '../task-form-cloud/task-form-cloud.component';
|
||||
import { TaskCloudService } from '../../../services/task-cloud.service';
|
||||
import { FormModel } from '../../../../../../../core';
|
||||
import { UserTaskCloudButtonsComponent } from '../user-task-cloud-buttons/user-task-cloud-buttons.component';
|
||||
|
||||
const createTaskDetailsCloudModel = (): TaskDetailsCloudModel => ({
|
||||
|
||||
+1
-1
@@ -166,7 +166,7 @@ export class UserTaskCloudComponent implements OnInit, OnChanges {
|
||||
* Emitted when a task is loaded`.
|
||||
*/
|
||||
@Output()
|
||||
onTaskLoaded = new EventEmitter<TaskDetailsCloudModel>(); /* eslint-disable-line */
|
||||
onTaskLoaded = new EventEmitter<TaskDetailsCloudModel>();
|
||||
|
||||
/** Emitted when the task is claimed. */
|
||||
@Output()
|
||||
|
||||
-1
@@ -88,7 +88,6 @@ const taskPresetsCloudDefaultModel = {
|
||||
};
|
||||
|
||||
@Directive()
|
||||
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
||||
export abstract class BaseTaskListCloudComponent<T = unknown>
|
||||
extends DataTableSchema<T>
|
||||
implements OnChanges, AfterContentInit, PaginatedComponent, OnInit
|
||||
|
||||
Reference in New Issue
Block a user