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

upgrade Eslint to version 9 and migrated the Eslint config #18

Closed
wants to merge 1 commit into from

Conversation

Crownpack07
Copy link

I have started the ESLint upgrade to version 9 here are some things that I have already done

Migrated the Eslint config to the new convention

https://eslint.org/docs/latest/use/migrate-to-9.0.0#-new-default-config-format-eslintconfigjs

Updated the unit tests to prevent duplicate tests:

I did this by adding an index to the code (I am not 100% sure if this is the right way to go about it). This is in response to a change that was implemented on the RuleTester

eslint/eslint#18235

Removed the slash library

It gave issues in terms of import resolution which I could not find a workaround so I simply replaced it with a local function and added unit tests for said local function.

Problems

Currently, a large majority of tests are not passing most of which fail due to an incorrect amount of errors

image

The other ones are invalid test cases that are failing due to unexpected output

image

I tried to investigate what the cause could be for these, but I am not even sure where to begin to look as there were no real changes to the actually implementation, so it might be one of the packages that require some changes post upgrade but I am not sure which package it would be

I will add here that I attempted this but very soon realized I was in a bit over my head, I would love to get some feedback in terms of what else I can try to resolve the final issues

If it will be less effort to just do the migration yourself then that is also okay and I can simply abandon the PR

@Crownpack07 Crownpack07 mentioned this pull request Nov 27, 2024
Limegrass added a commit that referenced this pull request Dec 1, 2024
With the help of the example of #18,
these changes should add support for eslint@9.

When building and running with the commit in that
pull request, eslint appears to act up locally.
There's probably some odd interaction with the declaration
of it becoming a ESM module. The module treatment likely
also affected how jest handled the mocking in the tests
that ultimately resulted in test failures.

In the end, it ended up being a bit easier to fix it by
starting clean and porting over necessary changes from the PR.

`rimraf` was mistakenly not declared as a direct dev dependency
before and was being used transiently from jest dependencies.
The dependency updates thus required that we pull it in
such that rimraf still exists as a dependency for us.
@Limegrass
Copy link
Owner

Thanks a bunch for this. I tried to work off of it; however, it seemed like I had issues with the plugin actually running whenever I pulled and built it locally. I tried a few things to get it working, but eventually decided to start from main and incrementally add the additions you showed here.

I would have otherwise given review comments; however, it sounded like you just needed the support, so I went ahead and pushed some changes for this and published a revision (1.5.0) to npm. That should hopefully work, but let me know if you face issues there. Tentatively closing this, but feel free to reopen.

@Limegrass Limegrass closed this Dec 1, 2024
Limegrass added a commit that referenced this pull request Dec 1, 2024
prettier@3 defaults trailingComma to on, which is nicer anyways.
Since this change is accepted, all files are formatted with the new
style using `fd . --exec npx prettier --write;`.

This change was spurred on by the update included in #18.
@Crownpack07
Copy link
Author

Thanks a million, I took a look at what you did in your commits for my sanity to check if I can get it to work on my local, and seemed like there were only a few steps I missed. Again thanks a lot for getting it sorted, I will let you know if we run into any issues post upgrade

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