eslint-config-jquery icon indicating copy to clipboard operation
eslint-config-jquery copied to clipboard

Upgrade to ESLint 9

Open miyasudokoro opened this issue 1 year ago • 10 comments

  1. Migrated to ESLint 9 configurations
  2. Updated all deprecated rules, including those that moved to @stylistic/js
  3. Implemented TODO: do not use the built version to check the code from test/fixtures/.eslintrc.js (deleted)
  4. Fixed the .gitattributes to actually enforce LF

miyasudokoro avatar Oct 18 '24 20:10 miyasudokoro

Note: JQuery 3.7.1 has an invalid eslint ignore statement that makes the tests fail for this project in ESLint 9, but that must be fixed in JQuery itself. The file attributes/prop.js has two "eslint ignore" statements for the same rule, which is no longer allowed. These should probably be changed to "eslint ignore next line" statements.

...\src\attributes\prop.js 113:4 error Rule "no-unused-expressions" is already configured by another configuration comment in the preceding code. This configuration is ignored

...\src\selector.js 2113:2 warning Unused eslint-enable directive (no matching eslint-disable directives were found)

miyasudokoro avatar Oct 18 '24 20:10 miyasudokoro

Note: JQuery 3.7.1 has an invalid eslint ignore statement that makes the tests fail for this project in ESLint 9

Don't worry about jQuery 3.7.1, we didn't have ESLint 9 or the flat config in the repo back then. The latest state of the 3.x-stable branch is the code for the next 3.x release and it doesn't have the comments you mentioned.

mgol avatar Oct 18 '24 23:10 mgol

@miyasudokoro Sorry for the delay, I just wanted to give you a status update. We are focused on releasing jQuery 4.0.0 now, I'm not sure if I'll be able to look at this PR finally before we do at least the RC release - and I want to test this on a few jQuery repositories.

Also, while in jQuery on the 3.x-stable branch we use ESLint 9, on main we use ESLint 8 due to incompatibility of eslint-plugin-import with ESLint 9 & the flat config. There's active work on that done at the moment, so I hope we'll be able to upgrade soon. I'd like to merge the PR only after that happens.

mgol avatar Nov 21 '24 17:11 mgol

BTW, the build is failing. Please update the Node.js version used in CI to 22, that should help.

mgol avatar Nov 21 '24 17:11 mgol

@mgol Thank you for the status updates. I am not very familiar with Github workflows, but I attempted to upgrade the Node.js version.

miyasudokoro avatar Dec 02 '24 18:12 miyasudokoro

Thanks for the Node update. The CI now fails on a different thing, can you have a look?

You don't have to wait for me approving the run, BTW - CI is mostly just doing npm install && npm test - or npm it for short - you can run it locally to find issues independently.

mgol avatar Dec 02 '24 18:12 mgol

@mgol Those CI errors are the two things I noted in my Oct 18 comment. The tests won't pass until we're testing a jquery version that has removed those two invalid lines. I vaguely remember going to make a branch of jquery to fix them but seeing that they were already fixed by somebody else's branch, so I think this will resolve itself via the jquery 4.0.0 release.

miyasudokoro avatar Dec 13 '24 18:12 miyasudokoro

@miyasudokoro Hey, are you interested in finishing this PR?

mgol avatar Mar 03 '25 17:03 mgol

I would like to finish this, but I don't have any time at the moment. If anyone else wants to jump in and fix it, be my guest. I might be able to come back to it in a month.

miyasudokoro avatar May 01 '25 17:05 miyasudokoro

@miyasudokoro No worries. Right now, we're busy trying to get 4.0.0-rc.1 out the door anyway, it'll take some time.

mgol avatar May 04 '25 11:05 mgol