Skip to content

Commit f277832

Browse files
authored
Merge pull request #4329 from 4Science/task/main/DURACOM-368
Enforce standalone components/directives/pipes via linting
2 parents ba3c43a + 7ec20ed commit f277832

File tree

20 files changed

+26
-2
lines changed

20 files changed

+26
-2
lines changed

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@
160160
]
161161
}
162162
],
163+
"@angular-eslint/prefer-standalone": [
164+
"error"
165+
],
163166
"@angular-eslint/no-attribute-decorator": "error",
164167
"@angular-eslint/no-output-native": "warn",
165168
"@angular-eslint/no-output-on-prefix": "warn",

src/app/browse-by/browse-by-page/browse-by-page.component.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { BrowseByPageComponent } from './browse-by-page.component';
2020
@Component({
2121
// eslint-disable-next-line @angular-eslint/component-selector
2222
selector: '',
23+
standalone: true,
2324
template: '<span id="BrowseByTestComponent"></span>',
2425
})
2526
class BrowseByTestComponent {

src/app/browse-by/browse-by-switcher/browse-by-switcher.component.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { BrowseBySwitcherComponent } from './browse-by-switcher.component';
2020
@Component({
2121
// eslint-disable-next-line @angular-eslint/component-selector
2222
selector: '',
23+
standalone: true,
2324
template: '<span id="BrowseByTestComponent"></span>',
2425
})
2526
class BrowseByTestComponent {

src/app/process-page/form/process-parameters/parameter-value-input/value-input.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
*/
1111
@Component({
1212
selector: 'ds-value-input',
13+
standalone: true,
1314
template: '',
1415
})
1516
export abstract class ValueInputComponent<T> {

src/app/shared/browse-by/browse-by.component.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import { BrowseByComponent } from './browse-by.component';
5858
@Component({
5959
// eslint-disable-next-line @angular-eslint/component-selector
6060
selector: 'ds-browse-entry-list-element',
61+
standalone: true,
6162
template: '',
6263
})
6364
class MockThemedBrowseEntryListElementComponent {

src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { ComcolBrowseByComponent } from './comcol-browse-by.component';
2323
@Component({
2424
// eslint-disable-next-line @angular-eslint/component-selector
2525
selector: '',
26+
standalone: true,
2627
template: '<span id="ComcolBrowseByComponent"></span>',
2728
})
2829
class BrowseByTestComponent {

src/app/shared/disabled-directive.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ import { By } from '@angular/platform-browser';
1111
import { BtnDisabledDirective } from './btn-disabled.directive';
1212

1313
@Component({
14+
standalone: true,
1415
template: `
1516
<button [dsBtnDisabled]="isDisabled">Test Button</button>
1617
`,
18+
imports: [
19+
BtnDisabledDirective,
20+
],
1721
})
1822
class TestComponent {
1923
isDisabled = false;
@@ -26,8 +30,7 @@ describe('DisabledDirective', () => {
2630

2731
beforeEach(() => {
2832
TestBed.configureTestingModule({
29-
imports: [BtnDisabledDirective],
30-
declarations: [TestComponent],
33+
imports: [BtnDisabledDirective, TestComponent],
3134
});
3235
fixture = TestBed.createComponent(TestComponent);
3336
component = fixture.componentInstance;

src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export enum SelectorActionType {
3434
*/
3535
@Component({
3636
selector: 'ds-dso-selector-modal',
37+
standalone: true,
3738
template: '',
3839
})
3940
export abstract class DSOSelectorModalWrapperComponent implements OnInit {

src/app/shared/form/builder/ds-dynamic-form-ui/models/dynamic-vocabulary.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { DsDynamicInputModel } from './ds-dynamic-input.model';
2828
*/
2929
@Component({
3030
selector: 'ds-dynamic-vocabulary',
31+
standalone: true,
3132
template: '',
3233
})
3334
export abstract class DsDynamicVocabularyComponent extends DynamicFormControlComponent {

src/app/shared/mydspace-actions/claimed-task/abstract/advanced-claimed-task-actions-abstract.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { ClaimedTaskActionsAbstractComponent } from './claimed-task-actions-abst
2727
*/
2828
@Component({
2929
selector: 'ds-advanced-claimed-task-action-abstract',
30+
standalone: true,
3031
template: '',
3132
})
3233
export abstract class AdvancedClaimedTaskActionsAbstractComponent extends ClaimedTaskActionsAbstractComponent implements OnInit {

0 commit comments

Comments
 (0)