Skip to content

Commit bcebdf9

Browse files
committed
style(examples): enabled eslint prefer-on-push rule (#DS-2920)
1 parent 1384c48 commit bcebdf9

File tree

216 files changed

+437
-212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+437
-212
lines changed

.commitlintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const config = {
3030
'experimental',
3131
'schematics',
3232
'dev',
33+
'examples',
3334

3435
// data-grid
3536
'ag-grid',

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ const componentsExamplesRules = {
245245
files: ['packages/docs-examples/**/*.ts'],
246246
rules: {
247247
'@angular-eslint/prefer-standalone': 1,
248-
'@angular-eslint/use-component-selector': 1
248+
'@angular-eslint/use-component-selector': 1,
249+
'@angular-eslint/prefer-on-push-component-change-detection': 1
249250
}
250251
};
251252

packages/docs-examples/components/accordion/accordion-content/accordion-content-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqAccordionModule } from '@koobiq/components/accordion';
33
import { KbqCheckboxModule } from '@koobiq/components/checkbox';
44

55
/**
66
* @title Accordion content
77
*/
88
@Component({
9+
changeDetection: ChangeDetectionStrategy.OnPush,
910
standalone: true,
1011
selector: 'accordion-content-example',
1112
templateUrl: 'accordion-content-example.html',

packages/docs-examples/components/accordion/accordion-header/accordion-header-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqAccordionModule } from '@koobiq/components/accordion';
33
import { KbqBadgeModule } from '@koobiq/components/badge';
44
import { KbqCheckboxModule } from '@koobiq/components/checkbox';
@@ -8,6 +8,7 @@ import { KbqIcon, KbqIconButton } from '@koobiq/components/icon';
88
* @title Accordion header
99
*/
1010
@Component({
11+
changeDetection: ChangeDetectionStrategy.OnPush,
1112
standalone: true,
1213
selector: 'accordion-header-example',
1314
templateUrl: 'accordion-header-example.html',

packages/docs-examples/components/accordion/accordion-in-panel/accordion-in-panel-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, TemplateRef, ViewChild } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component, TemplateRef, ViewChild } from '@angular/core';
22
import { KbqAccordionModule } from '@koobiq/components/accordion';
33
import { KbqButtonModule } from '@koobiq/components/button';
44
import {
@@ -12,6 +12,7 @@ import {
1212
* @title Accordion in panel
1313
*/
1414
@Component({
15+
changeDetection: ChangeDetectionStrategy.OnPush,
1516
standalone: true,
1617
selector: 'accordion-in-panel-example',
1718
templateUrl: 'accordion-in-panel-example.html',

packages/docs-examples/components/accordion/accordion-in-section/accordion-in-section-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqAccordionModule } from '@koobiq/components/accordion';
33

44
/**
55
* @title Accordion in section
66
*/
77
@Component({
8+
changeDetection: ChangeDetectionStrategy.OnPush,
89
standalone: true,
910
selector: 'accordion-in-section-example',
1011
templateUrl: 'accordion-in-section-example.html',

packages/docs-examples/components/accordion/accordion-inactive-section/accordion-inactive-section-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqAccordionModule } from '@koobiq/components/accordion';
33

44
/**
55
* @title Accordion inactive section
66
*/
77
@Component({
8+
changeDetection: ChangeDetectionStrategy.OnPush,
89
standalone: true,
910
selector: 'accordion-inactive-section-example',
1011
templateUrl: 'accordion-inactive-section-example.html',

packages/docs-examples/components/accordion/accordion-overview/accordion-overview-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqAccordionModule } from '@koobiq/components/accordion';
33

44
/**
55
* @title Accordion
66
*/
77
@Component({
8+
changeDetection: ChangeDetectionStrategy.OnPush,
89
standalone: true,
910
selector: 'accordion-overview-example',
1011
templateUrl: 'accordion-overview-example.html',

packages/docs-examples/components/accordion/accordion-sections/accordion-sections-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqAccordionModule } from '@koobiq/components/accordion';
33
import { KbqButtonToggleModule } from '@koobiq/components/button-toggle';
44

55
/**
66
* @title Accordion sections
77
*/
88
@Component({
9+
changeDetection: ChangeDetectionStrategy.OnPush,
910
standalone: true,
1011
selector: 'accordion-sections-example',
1112
templateUrl: 'accordion-sections-example.html',

packages/docs-examples/components/accordion/accordion-states/accordion-states-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqAccordionModule, KbqAccordionVariant } from '@koobiq/components/accordion';
33
import { KbqButtonToggleModule } from '@koobiq/components/button-toggle';
44

55
/**
66
* @title Accordion states
77
*/
88
@Component({
9+
changeDetection: ChangeDetectionStrategy.OnPush,
910
standalone: true,
1011
selector: 'accordion-states-example',
1112
templateUrl: 'accordion-states-example.html',

packages/docs-examples/components/alert/alert-close/alert-close-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { animate, state, style, transition, trigger } from '@angular/animations';
2-
import { Component } from '@angular/core';
2+
import { ChangeDetectionStrategy, Component } from '@angular/core';
33
import { KbqAlertModule } from '@koobiq/components/alert';
44
import { KbqButtonStyles } from '@koobiq/components/button';
55
import { KbqComponentColors } from '@koobiq/components/core';
@@ -9,6 +9,7 @@ import { KbqIconModule } from '@koobiq/components/icon';
99
* @title Alert close
1010
*/
1111
@Component({
12+
changeDetection: ChangeDetectionStrategy.OnPush,
1213
standalone: true,
1314
selector: 'alert-close-example',
1415
animations: [

packages/docs-examples/components/alert/alert-content/alert-content-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { animate, state, style, transition, trigger } from '@angular/animations';
2-
import { Component } from '@angular/core';
2+
import { ChangeDetectionStrategy, Component } from '@angular/core';
33
import { KbqAlertColors, KbqAlertModule, KbqAlertStyles } from '@koobiq/components/alert';
44
import { KbqButtonModule, KbqButtonStyles } from '@koobiq/components/button';
55
import { KbqComponentColors } from '@koobiq/components/core';
@@ -10,6 +10,7 @@ import { KbqLinkModule } from '@koobiq/components/link';
1010
* @title Alert content
1111
*/
1212
@Component({
13+
changeDetection: ChangeDetectionStrategy.OnPush,
1314
standalone: true,
1415
selector: 'alert-content-example',
1516
templateUrl: 'alert-content-example.html',

packages/docs-examples/components/alert/alert-size/alert-size-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { animate, state, style, transition, trigger } from '@angular/animations';
2-
import { Component } from '@angular/core';
2+
import { ChangeDetectionStrategy, Component } from '@angular/core';
33
import { KbqAlertModule } from '@koobiq/components/alert';
44
import { KbqButtonStyles } from '@koobiq/components/button';
55
import { KbqComponentColors } from '@koobiq/components/core';
@@ -9,6 +9,7 @@ import { KbqLinkModule } from '@koobiq/components/link';
99
* @title Alert size
1010
*/
1111
@Component({
12+
changeDetection: ChangeDetectionStrategy.OnPush,
1213
standalone: true,
1314
selector: 'alert-size-example',
1415
templateUrl: 'alert-size-example.html',

packages/docs-examples/components/alert/alert-status/alert-status-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { animate, state, style, transition, trigger } from '@angular/animations';
2-
import { Component } from '@angular/core';
2+
import { ChangeDetectionStrategy, Component } from '@angular/core';
33
import { KbqAlertColors, KbqAlertModule, KbqAlertStyles } from '@koobiq/components/alert';
44
import { KbqButtonStyles } from '@koobiq/components/button';
55
import { KbqComponentColors } from '@koobiq/components/core';
@@ -9,6 +9,7 @@ import { KbqIconModule } from '@koobiq/components/icon';
99
* @title Alert status
1010
*/
1111
@Component({
12+
changeDetection: ChangeDetectionStrategy.OnPush,
1213
standalone: true,
1314
selector: 'alert-status-example',
1415
templateUrl: 'alert-status-example.html',

packages/docs-examples/components/alert/alert-variants/alert-variants-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { animate, state, style, transition, trigger } from '@angular/animations';
2-
import { Component } from '@angular/core';
2+
import { ChangeDetectionStrategy, Component } from '@angular/core';
33
import { KbqAlertColors, KbqAlertModule, KbqAlertStyles } from '@koobiq/components/alert';
44
import { KbqButtonStyles } from '@koobiq/components/button';
55
import { KbqComponentColors } from '@koobiq/components/core';
@@ -9,6 +9,7 @@ import { KbqIconModule } from '@koobiq/components/icon';
99
* @title Alert variants
1010
*/
1111
@Component({
12+
changeDetection: ChangeDetectionStrategy.OnPush,
1213
standalone: true,
1314
selector: 'alert-variants-example',
1415
styleUrls: ['alert-variants-example.css'],

packages/docs-examples/components/autocomplete/autocomplete-overview/autocomplete-overview-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AsyncPipe } from '@angular/common';
2-
import { Component, OnInit } from '@angular/core';
2+
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
33
import { FormControl, ReactiveFormsModule } from '@angular/forms';
44
import { KbqAutocompleteModule } from '@koobiq/components/autocomplete';
55
import { KbqFormsModule } from '@koobiq/components/core';
@@ -12,6 +12,7 @@ import { map, startWith } from 'rxjs/operators';
1212
* @title Autocomplete
1313
*/
1414
@Component({
15+
changeDetection: ChangeDetectionStrategy.OnPush,
1516
standalone: true,
1617
selector: 'autocomplete-overview-example',
1718
imports: [

packages/docs-examples/components/badge/badge-content/badge-content-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqBadgeColors, KbqBadgeModule } from '@koobiq/components/badge';
33
import { KbqIconModule } from '@koobiq/components/icon';
44

55
/**
66
* @title Badge content
77
*/
88
@Component({
9+
changeDetection: ChangeDetectionStrategy.OnPush,
910
standalone: true,
1011
selector: 'badge-content-example',
1112
imports: [

packages/docs-examples/components/badge/badge-fill-and-style/badge-fill-and-style-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqBadgeColors, KbqBadgeModule } from '@koobiq/components/badge';
33

44
/**
55
* @title Badge fill and style
66
*/
77
@Component({
8+
changeDetection: ChangeDetectionStrategy.OnPush,
89
standalone: true,
910
selector: 'badge-fill-and-style-example',
1011
templateUrl: 'badge-fill-and-style-example.html',

packages/docs-examples/components/badge/badge-list/badge-list-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqBadgeColors, KbqBadgeModule } from '@koobiq/components/badge';
33

44
/**
55
* @title Badge list
66
*/
77
@Component({
8+
changeDetection: ChangeDetectionStrategy.OnPush,
89
standalone: true,
910
selector: 'badge-list-example',
1011
styleUrls: ['badge-list-example.css'],

packages/docs-examples/components/badge/badge-size/badge-size-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqBadgeColors, KbqBadgeModule } from '@koobiq/components/badge';
33

44
/**
55
* @title Badge size
66
*/
77
@Component({
8+
changeDetection: ChangeDetectionStrategy.OnPush,
89
standalone: true,
910
selector: 'badge-size-example',
1011
imports: [

packages/docs-examples/components/badge/badge-table/badge-table-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqBadgeColors, KbqBadgeModule } from '@koobiq/components/badge';
33
import { KbqLinkModule } from '@koobiq/components/link';
44
import { KbqTableModule } from '@koobiq/components/table';
@@ -7,6 +7,7 @@ import { KbqTableModule } from '@koobiq/components/table';
77
* @title Badge table
88
*/
99
@Component({
10+
changeDetection: ChangeDetectionStrategy.OnPush,
1011
standalone: true,
1112
selector: 'badge-table-example',
1213
templateUrl: 'badge-table-example.html',

packages/docs-examples/components/badge/badge-tooltip/badge-tooltip-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqBadgeColors, KbqBadgeModule } from '@koobiq/components/badge';
33
import { PopUpPlacements } from '@koobiq/components/core';
44
import { KbqToolTipModule } from '@koobiq/components/tooltip';
@@ -7,6 +7,7 @@ import { KbqToolTipModule } from '@koobiq/components/tooltip';
77
* @title Badge tooltip
88
*/
99
@Component({
10+
changeDetection: ChangeDetectionStrategy.OnPush,
1011
standalone: true,
1112
selector: 'badge-tooltip-example',
1213
styleUrls: ['badge-tooltip-example.css'],

packages/docs-examples/components/button-toggle/button-toggle-alignment-overview/button-toggle-alignment-overview-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { FormsModule } from '@angular/forms';
33
import { KbqButtonToggleModule } from '@koobiq/components/button-toggle';
44
import { KbqIconModule } from '@koobiq/components/icon';
@@ -7,6 +7,7 @@ import { KbqIconModule } from '@koobiq/components/icon';
77
* @title Button toggle alignment
88
*/
99
@Component({
10+
changeDetection: ChangeDetectionStrategy.OnPush,
1011
standalone: true,
1112
selector: 'button-toggle-alignment-overview-example',
1213
templateUrl: 'button-toggle-alignment-overview-example.html',

packages/docs-examples/components/button-toggle/button-toggle-disabled-all-overview/button-toggle-disabled-all-overview-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { FormsModule } from '@angular/forms';
33
import { KbqButtonToggleModule } from '@koobiq/components/button-toggle';
44
import { KbqIconModule } from '@koobiq/components/icon';
@@ -7,6 +7,7 @@ import { KbqIconModule } from '@koobiq/components/icon';
77
* @title Button toggle disabled all
88
*/
99
@Component({
10+
changeDetection: ChangeDetectionStrategy.OnPush,
1011
standalone: true,
1112
selector: 'button-toggle-disabled-all-overview-example',
1213
templateUrl: 'button-toggle-disabled-all-overview-example.html',

packages/docs-examples/components/button-toggle/button-toggle-disabled-partial-overview/button-toggle-disabled-partial-overview-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqButtonToggleModule } from '@koobiq/components/button-toggle';
33
import { KbqIconModule } from '@koobiq/components/icon';
44

55
/**
66
* @title Button toggle disabled partial
77
*/
88
@Component({
9+
changeDetection: ChangeDetectionStrategy.OnPush,
910
standalone: true,
1011
selector: 'button-toggle-disabled-partial-overview-example',
1112
templateUrl: 'button-toggle-disabled-partial-overview-example.html',

packages/docs-examples/components/button-toggle/button-toggle-overview/button-toggle-overview-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqButtonToggleModule } from '@koobiq/components/button-toggle';
33
import { KbqIconModule } from '@koobiq/components/icon';
44

55
/**
66
* @title Button toggle
77
*/
88
@Component({
9+
changeDetection: ChangeDetectionStrategy.OnPush,
910
standalone: true,
1011
selector: 'button-toggle-overview-example',
1112
templateUrl: 'button-toggle-overview-example.html',

packages/docs-examples/components/button-toggle/button-toggle-tooltip-overview/button-toggle-tooltip-overview-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { FormsModule } from '@angular/forms';
33
import { KbqButtonToggleModule } from '@koobiq/components/button-toggle';
44
import { KbqIconModule } from '@koobiq/components/icon';
@@ -7,6 +7,7 @@ import { KbqIconModule } from '@koobiq/components/icon';
77
* @title Button toggle tooltip
88
*/
99
@Component({
10+
changeDetection: ChangeDetectionStrategy.OnPush,
1011
standalone: true,
1112
selector: 'button-toggle-tooltip-overview-example',
1213
styleUrls: ['button-toggle-tooltip-overview-example.css'],

packages/docs-examples/components/button/button-content/button-content-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqButtonModule } from '@koobiq/components/button';
33
import { KbqComponentColors } from '@koobiq/components/core';
44
import { KbqIconModule } from '@koobiq/components/icon';
@@ -7,6 +7,7 @@ import { KbqIconModule } from '@koobiq/components/icon';
77
* @title Button content
88
*/
99
@Component({
10+
changeDetection: ChangeDetectionStrategy.OnPush,
1011
standalone: true,
1112
selector: 'button-content-example',
1213
styleUrls: ['button-content-example.css'],

packages/docs-examples/components/button/button-fill-and-style-only-icon/button-fill-and-style-only-icon-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { KbqButtonModule, KbqButtonStyles } from '@koobiq/components/button';
33
import { KbqComponentColors } from '@koobiq/components/core';
44
import { KbqIconModule } from '@koobiq/components/icon';
@@ -7,6 +7,7 @@ import { KbqIconModule } from '@koobiq/components/icon';
77
* @title button-fill-and-style-only-icon
88
*/
99
@Component({
10+
changeDetection: ChangeDetectionStrategy.OnPush,
1011
standalone: true,
1112
selector: 'button-fill-and-style-only-icon-example',
1213
templateUrl: 'button-fill-and-style-only-icon-example.html',

0 commit comments

Comments
 (0)