Skip to content

chore: upgrade to ESLint v9 #573

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

Merged
merged 8 commits into from
Jun 26, 2025
Merged

chore: upgrade to ESLint v9 #573

merged 8 commits into from
Jun 26, 2025

Conversation

bmish
Copy link
Member

@bmish bmish commented Jun 23, 2025

Upgrades all the eslint plugins so we can use their flat configs for ESLint v9.

Everything is passing except Node 16 because ESLint v9 RuleTester uses structuredClone which is only available in Node 17+. So for now I've stopped testing under Node 16 although we will still support it until the next major release.

QUnit.module({ beforeEach: function (assert) { var done; done = assert.async(); } });:
     ConfigError: ESLint configuration in rule-tester is invalid: Config (unnamed): Key "rules": Key "rule-tester/validate-ast": structuredClone is not defined

Comment on lines +85 to +102
/* istanbul ignore next */
if (callExprNode.type !== "CallExpression") {
return null;
}
/* istanbul ignore next */
if (callExprNode.callee.type !== "MemberExpression") {
return null;
}
/* istanbul ignore next */
if (callExprNode.callee.object.type !== "Identifier") {
return null;
}
/* istanbul ignore next */
if (
callExprNode.callee.property.type !== "Identifier"
) {
return null;
}
Copy link
Member Author

@bmish bmish Jun 23, 2025

Choose a reason for hiding this comment

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

This fixes an actual crash caught by eslint-remote-tester:

Repository: l10n-tw/canvas-lms
[143](https://github.com/qunitjs/eslint-plugin-qunit/actions/runs/15812921911/job/44566834381?pr=573#step:5:144)
Rule: qunit/no-compare-relation-boolean
[144](https://github.com/qunitjs/eslint-plugin-qunit/actions/runs/15812921911/job/44566834381?pr=573#step:5:145)
Message: Cannot read properties of undefined (reading 'name')
[145](https://github.com/qunitjs/eslint-plugin-qunit/actions/runs/15812921911/job/44566834381?pr=573#step:5:146)
Occurred while linting /home/runner/work/eslint-plugin-qunit/eslint-plugin-qunit/node_modules/eslint-remote-tester/.cache-eslint-remote-tester/l10n-tw/canvas-lms/spec/javascripts/jsx/shared/helpers/JQuerySelectorCacheSpec.js:38
[146](https://github.com/qunitjs/eslint-plugin-qunit/actions/runs/15812921911/job/44566834381?pr=573#step:5:147)
Rule: "qunit/no-compare-relation-boolean"
[147](https://github.com/qunitjs/eslint-plugin-qunit/actions/runs/15812921911/job/44566834381?pr=573#step:5:148)
Path: l10n-tw/canvas-lms/spec/javascripts/jsx/shared/helpers/JQuerySelectorCacheSpec.js
[148](https://github.com/qunitjs/eslint-plugin-qunit/actions/runs/15812921911/job/44566834381?pr=573#step:5:149)
Link: https://github.com/l10n-tw/canvas-lms/blob/HEAD/spec/javascripts/jsx/shared/helpers/JQuerySelectorCacheSpec.js#L38
[149](https://github.com/qunitjs/eslint-plugin-qunit/actions/runs/15812921911/job/44566834381?pr=573#step:5:150)

[150](https://github.com/qunitjs/eslint-plugin-qunit/actions/runs/15812921911/job/44566834381?pr=573#step:5:151)
  36 |     test('returns a jquery selector', () => {
[151](https://github.com/qunitjs/eslint-plugin-qunit/actions/runs/15812921911/job/44566834381?pr=573#step:5:152)
  37 |       const response = selectorCache.get('#foo')
[152](https://github.com/qunitjs/eslint-plugin-qunit/actions/runs/15812921911/job/44566834381?pr=573#step:5:153)
> 38 |       strictEqual(response instanceof $, true)
[153](https://github.com/qunitjs/eslint-plugin-qunit/actions/runs/15812921911/job/44566834381?pr=573#step:5:154)
  39 |     })
[154](https://github.com/qunitjs/eslint-plugin-qunit/actions/runs/15812921911/job/44566834381?pr=573#step:5:155)
  40 |
[155](https://github.com/qunitjs/eslint-plugin-qunit/actions/runs/15812921911/job/44566834381?pr=573#step:5:156)
  41 |     test('returns the selector for the given element', () => {

This fix is pulled from the TypeScript PR: #571

@bmish bmish mentioned this pull request Jun 23, 2025
@bmish bmish changed the title chore: upgrade to eslint v9 chore: upgrade to ESLint v9 Jun 26, 2025
@coveralls
Copy link

coveralls commented Jun 26, 2025

Pull Request Test Coverage Report for Build 15890657328

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 15890547008: 0.0%
Covered Lines: 895
Relevant Lines: 895

💛 - Coveralls

@bmish
Copy link
Member Author

bmish commented Jun 26, 2025

I'm going to merge this now for a forthcoming minor release. I'm open to receiving and addressing feedback after the merge.

@bmish bmish merged commit 572305f into qunitjs:main Jun 26, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants