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

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

rhopman
Copy link
Contributor

@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
@rhopman rhopman force-pushed the migrate-tslint-to-eslint branch from 522f6d6 to 12365f7 Compare September 30, 2024 08:37
@rhopman
Copy link
Contributor Author

rhopman commented Oct 8, 2024

This is my first PR on the project so I hope I did everything right. Is there anybody who could review this, and let me know if there's anything I need to do or change? Perhaps @alberto-art3ch?

@rhopman
Copy link
Contributor Author

rhopman commented Oct 10, 2024

@PC-11-00 @alberto-art3ch @janez89 @somasorosdpc is anybody able to review this PR please? I realize it touches a lot of files but the changes are all pretty minor. If somebody has a better approach to get rid of this deprecated dependency I'm open to suggestions!

@adamsaghy
Copy link
Collaborator

@rhopman I am sorry to be slow on this PR. Can you please resolve the conflicts and we can give a try to review it

@rhopman rhopman force-pushed the migrate-tslint-to-eslint branch from 12365f7 to f074cb3 Compare November 6, 2024 10:45
@rhopman
Copy link
Contributor Author

rhopman commented Nov 6, 2024

Thanks, @adamsaghy! I've resolved the merge conflicts. Please let me know if there's anything else I can do to assist in the process.

@adamsaghy
Copy link
Collaborator

@alberto-art3ch Please help me to review this PR.

@adamsaghy
Copy link
Collaborator

@rhopman Please kindly check the failing lint validation:

Linting "mifosx-web-app"...

/home/runner/work/web-app/web-app/src/app/loans/loans-view/account-details/account-details.component.html
Error:   14:26   error  Expected `===` but received `==`  @angular-eslint/template/eqeqeq
Lint errors found in the listed files.

Error:   14:73   error  Expected `!==` but received `!=`  @angular-eslint/template/eqeqeq
Error:   14:126  error  Expected `!==` but received `!=`  @angular-eslint/template/eqeqeq

✖ 3 problems (3 errors, 0 warnings)


Linting "mifosx-web-app-e2e"...

All files pass linting.

Error: Process completed with exit code 1.

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
@rhopman rhopman force-pushed the migrate-tslint-to-eslint branch from f074cb3 to 4f815bb Compare November 6, 2024 14:15
@rhopman
Copy link
Contributor Author

rhopman commented Nov 6, 2024

Apologies @adamsaghy, the linting issue should be fixed now.

Copy link
Collaborator

@adamsaghy adamsaghy left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@alberto-art3ch alberto-art3ch left a comment

Choose a reason for hiding this comment

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

LGTM

@adamsaghy adamsaghy merged commit 9034ce2 into openMF:master Nov 8, 2024
1 of 2 checks passed
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.

3 participants