test(linter/plugins): Add eslint-plugin-mocha to JS Plugins conformance suite#20611
test(linter/plugins): Add eslint-plugin-mocha to JS Plugins conformance suite#20611overlookmotel merged 2 commits intomainfrom
Conversation
|
Feel free to close this PR and just make it an issue, but I figured the actual conformance run would be helpful for confirming this and everything |
|
Thanks for unearthing this. I've opened an issue #20700 to discuss the problem and our options for solving it. Let's keep this PR open and we can rebase it once we have a fix, and check the fix works. |
|
If we merge #20799, it fixes the |
…sourceCode` (#20799) Fixes #20700. Patch global `WeakMap` before loading plugins to make a `WeakMap` keyed by `context.sourceCode` act as if every file has a unique `context.sourceCode`. The runtime cost of this patch is very low - for the use case of `WeakMap` keyed by `SourceCode`, it should be *faster* than an actual `WeakMap`, as no methods do actual hash map lookups. The implementation takes care not to leak memory even if plugins use `WeakMap`s extensively or in pathological patterns. I rebased #20611 on top of this, and after this PR, 100% of `eslint-plugin-mocha`'s conformance tests pass. It's pretty hacky to be patching globals, but I believe the implementation to be robust. My rationale for this solution is explained in detail in #20700.
…ce suite. I need to investigate why many of these are failing right now.
3ae1e71 to
fa910a7
Compare
There was a problem hiding this comment.
Pull request overview
Adds eslint-plugin-mocha to the oxlint JS-plugins conformance harness so its rule tests can be executed and tracked via snapshots alongside other plugin suites.
Changes:
- Introduce a new conformance test group configuration for
mocha. - Register the
mochagroup in the conformance group index. - Extend
init.shto clone/installeslint-plugin-mochaand add an initial conformance snapshot.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/oxlint/conformance/src/groups/mocha.ts | Defines the new conformance group (submodule name, test directory, filename mapping, RuleTester replacement). |
| apps/oxlint/conformance/src/groups/index.ts | Adds the mocha group to the set of executed conformance suites. |
| apps/oxlint/conformance/snapshots/mocha.md | Adds a snapshot for mocha conformance results. |
| apps/oxlint/conformance/init.sh | Clones eslint-plugin-mocha at a pinned SHA and installs its dependencies. |
|
#20799 is merged, and 100% of tests now pass. @connorshea I deleted your very useful description on this PR, just because it's no longer accurate. The content of your root cause analysis is covered in issue #20700. |
Merge activity
|
Add
eslint-plugin-mochato Oxlint JS plugins conformance tests suite. 100% of tests passing.