Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from the deprecated TSLint to Angluar ESLint #2175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rhopman
Copy link

@rhopman rhopman commented Sep 26, 2024

Description

TSLint was deprecated by its creators in 2019. This PR replaces Codelyzer and TSLint with Angular ESLint, as recommended in the deprecation notice.

I followed the steps in Migrating from TSLint: Current Status as of angular-eslint v16 to migrate.

To resolve linting errors, I made the following code fixes:

  • To fix @angular-eslint/template/eqeqeq, I replaced == and != operators with === and !== respectively, after verifying each occurrence to make sure that there would be no functional impact.
  • To fix @angular-eslint/no-empty-lifecycle-method (Lifecycle methods should not be empty), I removed all empty lifecycle methods (mostly ngOnInit).
  • To fix @angular-eslint/no-output-native (Output bindings, including aliases, should not be named as standard DOM events), I renamed @Output() submit to @Output() submitEvent.
  • To fix @angular-eslint/template/no-negated-async (Async pipe results should not be negated), I changed !(isHandset$ | async) to (isHandset$ | async) === false in shell.component.html.

After the above fixes, npx ng lint runs without issues.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • If you have multiple commits please combine them into one commit by squashing them.

  • Read and understood the contribution guidelines at web-app/.github/CONTRIBUTING.md.

@rhopman rhopman marked this pull request as ready for review September 26, 2024 08:15
Migrate from the deprecated TSLint to Angluar ESLint. Also fix current
linting issues in the code, in particular:

- Use strict equals operators (=== and !==)
- Remove empty lifecycle methods (mostly ngOnInit)
- Output bindings including aliases should not be named as standard dom
  events (submit)
- Async pipe results should not be negated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant