feat: add eslint 10 support#1077
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Why are errors being removed from the test cases? |
|
To my best understanding, these ESLint 10 appears to have added Specifically:
Apologies for not calling this out more clearly in the description — it's mentioned briefly under "Stray Happy to be corrected if I've misread any of these — please let me know! |
|
Do you want to disclose your use of generative AI while creating this PR and its description? |
|
@StephanTLavavej I'm happy to. I became interested in LLM-assisted open source contribution after modernizing several legacy applications at my day job. Happy to discuss further outside this PR if you're curious about the workflow. |
|
Unfortunately LLM output can't be copyrighted, and thus can't ever be a valid open source contribution. Please do not ever use LLMs for generating open source work. If you've done so here, please remove it and rewrite it by hand. As for the error removal - a separate commit that just removes the errors on valid test cases would be helpful. |
|
Closing this PR — I respect maintainers' right to set contribution policies. As someone with a J.D., I'll briefly note that the legal claim here is oversimplified. U.S. copyright law distinguishes between purely AI-generated works (not copyrightable) and human-authored works created with AI assistance (copyrightable per the Copyright Office's March 2023 guidance). These are different categories. But this isn't the venue for that debate — happy to leave it there. |
|
To be clear, I'm not objecting to using LLMs to suggest changes and debug problems, or even for automating application of human-produced changes - just for letting it write the code for you. The line between "AI assistance" and "purely AI-generated" is untested in court (to my knowledge) and as such seems like a subjective determination of the copyright office and/or a judge, so zero-budget open source projects don't likely have the wherewithal to take on that risk. |
|
Counteroffer: you teach me how to write code better and I will explain why I think you are wrong on the legal analysis and risks. |
Hi! This adds ESLint 10 support, closing #1075.
Tested locally against ESLint 3–10 — all tests pass across every version.
What changed
RuleTester wrapper — The previous wrapper overrode
RuleTester.prototype.run, which breaks in ESLint 10 due to new stack-frame introspection ingetInvocationLocation(). Rewrote it to use only the documentedRuleTester.describeandRuleTester.ithooks instead. The new approach uses a simple module-level variable with stack-based save/restore instead of storing state as properties on function objects, somock-propertyis no longer needed and has been removed from devDependencies.TestCaseError#typeremoval — ESLint 10 dropped thetypeproperty from test case errors. Rather than touching all 39 rule test files, theparserOptionsMappernow conditionally stripstypefrom error objects for ESLint 10+ (using the existingobject.fromentriesandobject.entriesdependencies).Stray
errorson valid test cases — ESLint 10 validates that valid test cases don't includeerrors. Five test files had valid cases with an accidentalerrorsproperty that ESLint 9 silently ignored. Removed the stray property from each.CI matrix — Added
eslint: 10with Node version exclusions matching ESLint 10's engine requirement (^20.19.0 || ^22.13.0 || >=24).Compatibility smoke test — New
eslint-compat-test.jsexercises the RuleTester/tape integration end-to-end with sequential runs to catch state management regressions in the wrapper.