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

fix(angular-standalone): update eslint #1861

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jcesarmobile
Copy link
Member

eslint 9 changed the configuration files and .eslintrc.json no longer works.

I first removed all the eslint related packages, .eslintrc.json file and eslint entries from angular.json.
Then ran ng add angular-eslint, which installs eslint-angular and related packages and configure the project with default angular configuration, creating a eslint.config.js and makes some automatic modifications to angular.json.
Then I replaced the no-underscore-dangle rule since it no longer caused issues, but added @typescript-eslint/no-explicit-any as it complains about that now.
Then removed tseslint.configs.stylistic config as it was causing lint errors about empty constructors.
Finally added Page to valid component suffixes since it was causing a lint error that Pages weren't named Component.

I made all the steps as separate commits to see the process better, but should be squashed on merge

closes #1860

@jcesarmobile jcesarmobile requested a review from a team as a code owner February 14, 2025 14:55
@jcesarmobile jcesarmobile requested review from brandyscarney and ShaneK and removed request for a team February 14, 2025 14:55
@jcesarmobile jcesarmobile changed the title fix: angular eslint fix(angular-standalone): update eslint Feb 14, 2025
@jcesarmobile
Copy link
Member Author

test are falling because the list template uses ev: any.
Not sure if I should add '@typescript-eslint/no-explicit-any': 'off', as vue template does.
Or change the code to

refresh(ev: RefresherCustomEvent) {
    setTimeout(() => {
      ev.detail.complete();
    }, 3000);
  }

or use CustomEvent instead of any as vue/react templates do.

@brandyscarney
Copy link
Member

I would use CustomEvent to match our docs but it's up to you.

@jcesarmobile
Copy link
Member Author

I've updated the whole refresher code to match the docs, but I find it weird that it was using the event detail before and now the event target

@brandyscarney
Copy link
Member

Yeah it seems like we're inconsistent between the different frameworks:

We should update these all to be the same.

Copy link
Member

@brandyscarney brandyscarney left a comment

Choose a reason for hiding this comment

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

I tested this locally and verified that all Angular test apps pass linting without errors. Additionally, introducing a lint error in a test is correctly detected by the linter.

@brandyscarney
Copy link
Member

This should pass now with the latest Ionic release.

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.

angular-eslint - not working
2 participants