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

chore: migrate to ESLint flat config #1673

Merged
merged 2 commits into from
Sep 10, 2024
Merged

Conversation

eglitise
Copy link
Collaborator

This PR migrates from the ESLint legacy eslintrc format to the new flat config format. Some additional changes were also required here:

  • The import module was removed as an explicit import, since it was not configured any further, and its rules are already being applied as part of @appium/eslint-config-appium-ts
  • The react-native module was removed, as does not seem to be actively maintained and is unlikely to be updated for ESLint 9 compatibility (and also this codebase does not use React Native anyway)
  • The configuration for the no-unused-vars rule was removed and instead applied to the @typescript-eslint/no-unused-vars rule (from @appium/eslint-config-appium-ts), which extends no-unused-vars
  • The configuration for the react/jsx-uses-vars rule was removed, since the @typescript-eslint/no-unused-vars rule seems to detect JSX variables just fine
  • Since .eslintignore is now integrated into the config file, the ignored file patterns have been changed to extend the .gitignore file

@github-actions github-actions bot added chore Internal changes not visible to the user dependencies Dependency updates, removals or additions labels Sep 10, 2024
Copy link
Contributor

@mykola-mokhnach mykola-mokhnach left a comment

Choose a reason for hiding this comment

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

It would be interesting to know if we could do the same for other appium modules. Last time I checked it the typescript stuff was still not compatible with eslint 9

@eglitise
Copy link
Collaborator Author

eglitise commented Sep 10, 2024

I think we can likely migrate to flat config everywhere, but probably not to ESLint 9.
Flat config can still parse config information in legacy format (like @appium/eslint-config-appium-ts in this case), but ESLint 9 requires plugins to support it. The Typescript plugins do have support for ESLint 9 since version 8, but some others do not. It might also be worth switching from eslint-plugin-import to eslint-plugin-import-x, which has several improvements.

@eglitise eglitise merged commit cea7dd6 into appium:main Sep 10, 2024
7 checks passed
@eglitise eglitise deleted the eslint-flat-config branch September 10, 2024 11:03
laib3 pushed a commit to laib3/appium-inspector that referenced this pull request Nov 16, 2024
* chore: migrate to ESLint flat config

* chore: run prettier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Internal changes not visible to the user dependencies Dependency updates, removals or additions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants