Skip to content

Commit

Permalink
fix: update @typescript-eslint/eslint-plugin to use deprecated rule (
Browse files Browse the repository at this point in the history
…#2756)

* fix: update `@typescript-eslint/eslint-plugin` to use deprecated rule

* Restore NX package. Update NX. Update rules.

* Update lint rules and address new issues.

* Formatting. Dependency bumps.

* Fix tests. Simplify changes.

* Fix integration test.

* Fix integration build.

* Fix storybook, update e2e-schematics

* Update package-lock

* Update snapshot

* Revert to interface rather than switching to type alias
  • Loading branch information
johnhwhite authored Sep 18, 2024
1 parent e1fd53c commit a4ab15a
Show file tree
Hide file tree
Showing 104 changed files with 3,598 additions and 3,264 deletions.
1 change: 0 additions & 1 deletion .eslintrc-overrides.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{
"files": ["*.ts"],
"rules": {
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-non-null-assertion": "warn",
Expand Down
10 changes: 2 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,12 @@
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript", "prettier"],
"rules": {
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript", "prettier"],
"rules": {
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
"rules": {}
},
{
"files": ["*.stories.@(ts|tsx|js|jsx|mjs|cjs)"],
Expand Down
1 change: 1 addition & 0 deletions apps/code-examples/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,6 @@
}
}
},
"implicitDependencies": ["eslint-config"],
"tags": []
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<sky-angular-tree-wrapper>
<tree-root #tree [nodes]="nodes">
<ng-template
#treeNodeFullTemplate
let-index="index"
let-node
let-templates="templates"
#treeNodeFullTemplate
>
<sky-angular-tree-node
[helpPopoverContent]="node.data.helpPopoverContent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<pre>{{ formGroup.value | json }}</pre>
</form>

<ng-template let-item="item" #planetSearchResultTemplate>
<ng-template #planetSearchResultTemplate let-item="item">
<strong>
{{ item.name }}
</strong>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<pre>{{ formGroup.value | json }}</pre>
</form>

<ng-template let-item="item" #oceanSearchResultTemplate>
<ng-template #oceanSearchResultTemplate let-item="item">
<sky-icon icon="long-arrow-right" />
{{ item.title }} &bull; ID {{ item.id }}
</ng-template>
3 changes: 0 additions & 3 deletions apps/e2e/help-inline-storybook/.storybook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"include": [
"../src/**/*.stories.ts",
"../src/**/*.stories.js",
"../src/**/*.stories.jsx",
"../src/**/*.stories.tsx",
"../src/**/*.stories.mdx",
"*.js",
"*.ts",
"./*"
Expand Down
2 changes: 1 addition & 1 deletion apps/e2e/lists-storybook/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'jest-preset-angular/setup-jest';
import 'resize-observer-polyfill';

// jsdom (used by Jest) doesn't natively support ResizeObserver, so use a polyfill.
global.ResizeObserver = require('resize-observer-polyfill');
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ export class FieldHeightsComponent implements AfterViewInit, OnDestroy {
console.log(`Doesn't match .height-measure`, heightElement);
}
});
this.ready.getValue() || this.ready.next(true);
if (!this.ready.getValue()) {
this.ready.next(true);
}
}),
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DOCUMENT } from '@angular/common';
import { Component, OnDestroy, OnInit, inject } from '@angular/core';
import { SkyModalService } from '@skyux/modals';
import { FontLoadingService } from '@skyux/storybook';
import { FontLoadingService } from '@skyux/storybook/font-loading';

import { delay } from 'rxjs';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ describe('Modals with viewkept toolbars', () => {

function openModal(): void {
getModalTrigger()?.click();
fixture.detectChanges;
}

async function scrollContentDown(): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { SkyModalService } from '@skyux/modals';
import { FontLoadingService } from '@skyux/storybook';
import { FontLoadingService } from '@skyux/storybook/font-loading';

import { delay } from 'rxjs';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ describe('Modals with wait', () => {

function openModal(): void {
getModalTrigger()?.click();
fixture.detectChanges;
}

let fixture: ComponentFixture<ModalWaitComponent>;
Expand Down
4 changes: 2 additions & 2 deletions libs/components/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"homepage": "https://github.com/blackbaud/skyux#readme",
"peerDependencies": {
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"@angular/common": "^18.2.5",
"@angular/core": "^18.2.5",
"@skyux/core": "0.0.0-PLACEHOLDER",
"@skyux/i18n": "0.0.0-PLACEHOLDER"
},
Expand Down
8 changes: 4 additions & 4 deletions libs/components/action-bars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
},
"homepage": "https://github.com/blackbaud/skyux#readme",
"peerDependencies": {
"@angular/animations": "^18.2.3",
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"@angular/platform-browser": "^18.2.3",
"@angular/animations": "^18.2.5",
"@angular/common": "^18.2.5",
"@angular/core": "^18.2.5",
"@angular/platform-browser": "^18.2.5",
"@skyux-sdk/testing": "0.0.0-PLACEHOLDER",
"@skyux/animations": "0.0.0-PLACEHOLDER",
"@skyux/core": "0.0.0-PLACEHOLDER",
Expand Down
6 changes: 3 additions & 3 deletions libs/components/ag-grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
}
},
"peerDependencies": {
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"@angular/forms": "^18.2.3",
"@angular/common": "^18.2.5",
"@angular/core": "^18.2.5",
"@angular/forms": "^18.2.5",
"@skyux/autonumeric": "0.0.0-PLACEHOLDER",
"@skyux/core": "0.0.0-PLACEHOLDER",
"@skyux/data-manager": "0.0.0-PLACEHOLDER",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,11 @@ describe('SkyAgGridDataManagerAdapterDirective', () => {
} as ColumnResizedEvent;

const viewState = dataState.views[0];
(viewState.columnWidths = {
viewState.columnWidths = {
xs: { name: 180, target: 220 },
sm: { name: 100, target: 400 },
}),
agGridComponent.columnResized.emit(columnResized);
};
agGridComponent.columnResized.emit(columnResized);
agGridDataManagerFixture.detectChanges();
await agGridDataManagerFixture.whenStable();

Expand Down Expand Up @@ -403,11 +403,11 @@ describe('SkyAgGridDataManagerAdapterDirective', () => {
} as ColumnResizedEvent;

const viewState = dataState.views[0];
(viewState.columnWidths = {
viewState.columnWidths = {
xs: { name: 100, target: 220 },
sm: { name: 300, target: 400 },
}),
agGridComponent.columnResized.emit(columnResized);
};
agGridComponent.columnResized.emit(columnResized);
agGridDataManagerFixture.detectChanges();
await agGridDataManagerFixture.whenStable();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import { SkyInlineDeleteModule } from '@skyux/layout';
selector: 'sky-ag-grid-row-delete',
template: `
<ng-template
#inlineDeleteTemplateRef
let-row
let-tableWidth="tableWidth()"
let-getRowDeleteItem="getRowDeleteItem"
let-cancelRowDelete="cancelRowDelete"
let-confirmRowDelete="confirmRowDelete"
#inlineDeleteTemplateRef
>
<div
#inlineDeleteRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ describe('SkyAgGridWrapperComponent', () => {
}

it('should not move focus when tab is pressed but cells are being edited', () => {
agGrid.api.stopEditing as jasmine.Spy;
fireKeyupEscape();
expect(agGrid.api.stopEditing).toHaveBeenCalled();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ export class SkyAgGridWrapperComponent
}
}

// eslint-disable-next-line complexity
public onAnchorFocus(event: FocusEvent): void {
const relatedTarget = event.relatedTarget as HTMLElement | undefined;
const previousWasGrid =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ describe('SkyAgGridService', () => {
'function',
);
expect(
(modernThemeGridOptions.icons?.['sortDescending'] as Function)(),
(modernThemeGridOptions.icons?.['sortDescending'] as () => string)(),
).toBe(`<i aria-hidden="true" class="sky-i-chevron-down"></i>`);
});

Expand Down Expand Up @@ -636,7 +636,7 @@ describe('SkyAgGridService', () => {
});

describe('getDefaultGridOptions getEditableFn', () => {
let cellClassRuleEditableFunction: Function;
let cellClassRuleEditableFunction: (params?: any) => boolean;
let cellClassParams: CellClassParams;

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export interface SkyAgGridAutocompleteProperties {
/**
* @deprecated Use SkyAgGridAutocompleteProperties instead.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
// eslint-disable-next-line
export interface SkyAutocompleteProperties
extends SkyAgGridAutocompleteProperties {}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export interface SkyAgGridDatepickerProperties {
/**
* @deprecated Use SkyAgGridDatepickerProperties instead.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
// eslint-disable-next-line
export interface SkyDatepickerProperties
extends SkyAgGridDatepickerProperties {}
4 changes: 2 additions & 2 deletions libs/components/angular-tree-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"homepage": "https://github.com/blackbaud/skyux#readme",
"peerDependencies": {
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"@angular/common": "^18.2.5",
"@angular/core": "^18.2.5",
"@blackbaud/angular-tree-component": "^1.0.0",
"@skyux/core": "0.0.0-PLACEHOLDER",
"@skyux/forms": "0.0.0-PLACEHOLDER",
Expand Down
6 changes: 3 additions & 3 deletions libs/components/animations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
},
"homepage": "https://github.com/blackbaud/skyux#readme",
"peerDependencies": {
"@angular/animations": "^18.2.3",
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3"
"@angular/animations": "^18.2.5",
"@angular/common": "^18.2.5",
"@angular/core": "^18.2.5"
},
"dependencies": {
"tslib": "^2.6.3"
Expand Down
4 changes: 2 additions & 2 deletions libs/components/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"homepage": "https://github.com/blackbaud/skyux#readme",
"peerDependencies": {
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3"
"@angular/common": "^18.2.5",
"@angular/core": "^18.2.5"
},
"dependencies": {
"tslib": "^2.6.3"
Expand Down
6 changes: 3 additions & 3 deletions libs/components/autonumeric/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
},
"homepage": "https://github.com/blackbaud/skyux#readme",
"peerDependencies": {
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"@angular/forms": "^18.2.3",
"@angular/common": "^18.2.5",
"@angular/core": "^18.2.5",
"@angular/forms": "^18.2.5",
"autonumeric": "^4.10.5"
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions libs/components/avatar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
},
"homepage": "https://github.com/blackbaud/skyux#readme",
"peerDependencies": {
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"@angular/platform-browser": "^18.2.3",
"@angular/common": "^18.2.5",
"@angular/core": "^18.2.5",
"@angular/platform-browser": "^18.2.5",
"@skyux-sdk/testing": "0.0.0-PLACEHOLDER",
"@skyux/core": "0.0.0-PLACEHOLDER",
"@skyux/errors": "0.0.0-PLACEHOLDER",
Expand Down
10 changes: 5 additions & 5 deletions libs/components/colorpicker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
},
"homepage": "https://github.com/blackbaud/skyux#readme",
"peerDependencies": {
"@angular/cdk": "^18.2.3",
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"@angular/forms": "^18.2.3",
"@angular/platform-browser": "^18.2.3",
"@angular/cdk": "^18.2.4",
"@angular/common": "^18.2.5",
"@angular/core": "^18.2.5",
"@angular/forms": "^18.2.5",
"@angular/platform-browser": "^18.2.5",
"@skyux-sdk/testing": "0.0.0-PLACEHOLDER",
"@skyux/core": "0.0.0-PLACEHOLDER",
"@skyux/forms": "0.0.0-PLACEHOLDER",
Expand Down
4 changes: 2 additions & 2 deletions libs/components/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"homepage": "https://github.com/blackbaud/skyux#readme",
"peerDependencies": {
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3"
"@angular/common": "^18.2.5",
"@angular/core": "^18.2.5"
},
"dependencies": {
"tslib": "^2.6.3"
Expand Down
4 changes: 2 additions & 2 deletions libs/components/config/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface RuntimeConfig {
includeRouteModule: boolean;
pactConfig?: SkyuxPactConfig;
params: SkyAppRuntimeConfigParams;
routes?: Object[]; // Dynamically added in sky-pages-module-generator.js
routes?: object[]; // Dynamically added in sky-pages-module-generator.js
routesPattern: string;
runtimeAlias: string;
spaPathAlias: string;
Expand All @@ -81,7 +81,7 @@ export interface SkyuxConfigAppTheming {

export interface SkyuxConfigApp {
base?: string;
externals?: Object;
externals?: object;
port?: string;
styles?: string[];
theming?: SkyuxConfigAppTheming;
Expand Down
10 changes: 5 additions & 5 deletions libs/components/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
},
"homepage": "https://github.com/blackbaud/skyux#readme",
"peerDependencies": {
"@angular/cdk": "^18.2.3",
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"@angular/platform-browser": "^18.2.3",
"@angular/router": "^18.2.3",
"@angular/cdk": "^18.2.4",
"@angular/common": "^18.2.5",
"@angular/core": "^18.2.5",
"@angular/platform-browser": "^18.2.5",
"@angular/router": "^18.2.5",
"@skyux/i18n": "0.0.0-PLACEHOLDER"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<ng-template let-item #myTemplate
<ng-template #myTemplate let-item
>Templated content ID: {{ item.id }}</ng-template
>
Loading

0 comments on commit a4ab15a

Please sign in to comment.