Skip to content

fix(igx-ts): resolve lint errors in Angular project templates#1668

Open
Copilot wants to merge 5 commits intomasterfrom
copilot/fix-lint-errors-igx-ts-templates
Open

fix(igx-ts): resolve lint errors in Angular project templates#1668
Copilot wants to merge 5 commits intomasterfrom
copilot/fix-lint-errors-igx-ts-templates

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 27, 2026

  • Fix no-useless-assignment in fintech-grid/data/financialData.ts
  • Fix no-useless-assignment in fintech-tree-grid/assets/financialData.ts
  • Fix no-useless-assignment in fintech-grid/__filePrefix__.ts
  • Fix no-useless-assignment in fintech-tree-grid/__filePrefix__.ts
  • Fix @typescript-eslint/no-empty-function + @typescript-eslint/no-unused-vars in local-storage.ts
  • Fix @typescript-eslint/no-unused-vars in jwt-util.ts (bare catch) and @typescript-eslint/no-empty-object-type (reverted object{} with eslint-disable comment to keep spec compatibility)
  • Fix @typescript-eslint/consistent-generic-constructors in external-auth.ts
  • Fix @typescript-eslint/no-unused-vars + @typescript-eslint/no-empty-function in facebook-provider.ts
  • Fix @angular-eslint/component-selector in generate/__filePrefix__.ts
  • Update eslint.config.js with argsIgnorePattern: '^_' for unused vars, and a spec file override disabling @typescript-eslint/no-empty-function and @typescript-eslint/class-literal-property-style for test files
  • Fix prefer-const in services.spec.ts - consolidate mockLocalStorage declaration and assignment

Copilot AI linked an issue Apr 27, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix lint errors in the igx-ts templates fix(igx-ts): resolve lint errors in Angular project templates Apr 27, 2026
Copilot AI requested a review from Hristo313 April 27, 2026 10:56
@Hristo313
Copy link
Copy Markdown
Contributor

@copilot Fix the test and lint errors for the authentication igx-ts template

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 27, 2026

@copilot Fix the test and lint errors for the authentication igx-ts template

Fixed in commit c7b24a2. The changes address:

  • eslint.config.js: Added a **/*.spec.ts override disabling @typescript-eslint/no-empty-function and @typescript-eslint/class-literal-property-style — test files legitimately use empty mock stubs and spy-compatible getters
  • jwt-util.ts: Reverted input: object back to input: {} with an eslint-disable comment — the object type broke the spec that calls encodeBase64Url with a string argument
  • services.spec.ts: Fixed prefer-const by merging the let mockLocalStorage declaration with its assignment into a single const mockLocalStorage = { ... }

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:

  • www.google-analytics.com
    • Triggering command: /usr/local/bin/node node packages/cli/bin/execute.js new --help de_modules/.bin/tsx (dns block)
    • Triggering command: /usr/local/bin/node node packages/cli/bin/execute.js config --help (dns block)
    • Triggering command: /usr/local/bin/node node packages/cli/bin/execute.js generate --help ages�� (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Hristo313 Hristo313 marked this pull request as ready for review April 27, 2026 11:44
Copilot AI review requested due to automatic review settings April 27, 2026 11:44
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 27, 2026

Coverage Status

coverage: 86.3%. remained the same — copilot/fix-lint-errors-igx-ts-templates into master

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's in the config now, it is needed in files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lint errors in the igx-ts templates

6 participants