fix(igx-ts): resolve lint errors in Angular project templates#1668
fix(igx-ts): resolve lint errors in Angular project templates#1668
Conversation
Agent-Logs-Url: https://github.com/IgniteUI/igniteui-cli/sessions/7b8fd45e-3305-47f3-b5b9-d795d5dea421 Co-authored-by: Hristo313 <57346540+Hristo313@users.noreply.github.com>
|
@copilot Fix the test and lint errors for the authentication igx-ts template |
Agent-Logs-Url: https://github.com/IgniteUI/igniteui-cli/sessions/e0f16fb9-d7fe-4d97-ae72-ce1f5d43e185 Co-authored-by: Hristo313 <57346540+Hristo313@users.noreply.github.com>
Fixed in commit c7b24a2. The changes address:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR focuses on removing ESLint violations in the igx-ts Angular templates (mostly unused vars / empty functions / selector conventions) so newly generated projects template-lint cleanly.
Changes:
- Refactors template/sample code to eliminate
no-useless-assignment,prefer-const, and unused variable lint errors. - Adjusts template implementations to satisfy TypeScript ESLint rules (e.g., optional catch binding, generic Map construction).
- Updates the base template ESLint flat config to ignore unused args prefixed with
_and relax a couple of test-only rules for*.spec.ts.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/igx-templates/igx-ts/projects/side-nav-auth/files/src/app/authentication/services/services.spec.ts | Consolidates mockLocalStorage into a single const to satisfy prefer-const / remove useless assignment. |
| packages/igx-templates/igx-ts/projects/side-nav-auth/files/src/app/authentication/services/local-storage.ts | Updates fallback Storage implementation to avoid unused-arg lint and disables no-empty-function where appropriate. |
| packages/igx-templates/igx-ts/projects/side-nav-auth/files/src/app/authentication/services/jwt-util.ts | Removes unused catch binding and adds a targeted eslint-disable for {} typing. |
| packages/igx-templates/igx-ts/projects/side-nav-auth/files/src/app/authentication/services/external-auth.ts | Updates Map construction to satisfy consistent generic constructor style. |
| packages/igx-templates/igx-ts/projects/side-nav-auth/files/src/app/authentication/providers/facebook-provider.ts | Tweaks FB.logout callback to address unused vars / empty function lint concerns. |
| packages/igx-templates/igx-ts/projects/_base/files/eslint.config.js | Adds _ args ignore pattern and test-file rule overrides in the base flat ESLint config. |
| packages/igx-templates/igx-ts/generate/files/src/app/path/filePrefix.ts | Updates generated component selector to match the enforced app- prefix convention. |
| packages/igx-templates/igx-ts/custom-templates/fintech-tree-grid/files/src/app/path/assets/financialData.ts | Removes useless assignment in generateNewPrice by switching to a direct const initialization. |
| packages/igx-templates/igx-ts/custom-templates/fintech-tree-grid/files/src/app/path/filePrefix.ts | Removes useless assignment in price calculation by initializing newPrice at first assignment. |
| packages/igx-templates/igx-ts/custom-templates/fintech-grid/files/src/app/path/data/financialData.ts | Removes useless assignment in generateNewPrice by switching to a direct const initialization. |
| packages/igx-templates/igx-ts/custom-templates/fintech-grid/files/src/app/path/filePrefix.ts | Removes useless assignment in price calculation by initializing newPrice at first assignment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| key(_index: number): string | null { return null; } | ||
| // eslint-disable-next-line @typescript-eslint/no-empty-function | ||
| removeItem(_key: string): void { } | ||
| // eslint-disable-next-line @typescript-eslint/no-empty-function |
There was a problem hiding this comment.
If that's in the config now, it is needed in files?
no-useless-assignmentinfintech-grid/data/financialData.tsno-useless-assignmentinfintech-tree-grid/assets/financialData.tsno-useless-assignmentinfintech-grid/__filePrefix__.tsno-useless-assignmentinfintech-tree-grid/__filePrefix__.ts@typescript-eslint/no-empty-function+@typescript-eslint/no-unused-varsinlocal-storage.ts@typescript-eslint/no-unused-varsinjwt-util.ts(bare catch) and@typescript-eslint/no-empty-object-type(revertedobject→{}with eslint-disable comment to keep spec compatibility)@typescript-eslint/consistent-generic-constructorsinexternal-auth.ts@typescript-eslint/no-unused-vars+@typescript-eslint/no-empty-functioninfacebook-provider.ts@angular-eslint/component-selectoringenerate/__filePrefix__.tseslint.config.jswithargsIgnorePattern: '^_'for unused vars, and a spec file override disabling@typescript-eslint/no-empty-functionand@typescript-eslint/class-literal-property-stylefor test filesprefer-constinservices.spec.ts- consolidatemockLocalStoragedeclaration and assignment