test(linter/plugins): add eslint-stylistic to conformance tests#18554
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
This PR adds eslint-plugin-stylistic to the conformance tests, validating Oxlint's compatibility with this plugin's 129 rules. The tests achieve an impressive 99.96% pass rate (18,303 passing out of 18,310 tests, excluding skipped tests). The 7 failing tests are documented with clear explanations of the root causes.
Changes:
- Added dependencies for
@typescript-eslint/parserandeslint-vitest-rule-testerto support stylistic plugin testing - Extended
RuleTesterto handle stylistic plugin's test format, including support for missingerrorsproperty via__unknown__marker - Created stylistic test group configuration with appropriate test transformations, parser handling, and skip conditions
- Added initialization script for cloning and setting up the stylistic plugin submodule with necessary patches
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Added @typescript-eslint/parser, eslint-vitest-rule-tester, and their dependencies to support stylistic plugin testing |
| apps/oxlint/package.json | Added @typescript-eslint/parser and eslint-vitest-rule-tester as dev dependencies |
| apps/oxlint/src-js/package/rule_tester.ts | Exported ParserOptionsInternal interface and added handling for __unknown__ errors marker used when test cases don't specify expected errors |
| apps/oxlint/conformance/tester.ts | Updated debug script to test stylistic plugin rules with TypeScript/ESLint parser integration |
| apps/oxlint/conformance/src/rule_tester.ts | Exported LanguageOptions and ParserOptions types needed by stylistic test group |
| apps/oxlint/conformance/src/groups/stylistic.ts | Created comprehensive test group for stylistic plugin with custom rule runner mock, parser handling, and skip conditions for known issues |
| apps/oxlint/conformance/src/groups/index.ts | Registered stylistic test group alongside existing groups |
| apps/oxlint/conformance/snapshots/stylistic.md | Documented conformance test results showing 99.96% pass rate with detailed failure analysis |
| apps/oxlint/conformance/init.sh | Added setup script for cloning stylistic plugin, installing dependencies, patching package.json for Node.js imports, and replacing top-level await imports |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8e1e684 to
a356696
Compare
ca2d841 to
e07c667
Compare
Merge activity
|
e07c667 to
da76bc5
Compare
…8554) Add `eslint-plugin-stylistic` to conformance tests. 99.96% pass rate. The remaining 7 failing tests are not easily fixable: #### `jsx-props-no-multi-spaces` rule 1 failing test The rule clones nodes with `Object.assign({}, node)`, and then uses the `loc` property of the cloned node. Because `loc` is a getter on *prototype* of AST nodes, `loc` property is not present on the cloned node. This bug may have real-world impact. We'll need to make `loc` a real property of node objects to fix it (#10307). We originally had `loc` getter on the node objects themselves, but that caused a 3x slowdown. #### `jsx-tag-spacing` rule 6 failing tests TypeScript parser (which we use for generating tokens) cannot parse closing JSX tags with whitespace before the `/` - e.g. `<App>text< /App>`. TS-ESLint parser also fails to parse this [AST explorer](https://ast-explorer.dev/#eNpFyzEKwzAMBdCrGM0p3UModOkROnkRRgUH1xaWUlqC716pHbJJ7/+/Q4EZVnyhpJ5ZYQI20A/TH04kJVf3ZL5cmS+P1pZw9su0me6xhhCB0hPv1CW3GmE2KKgkGmE68huhbp3EC7+ZB6u8/de+kdOIdcD4AgUpMYU=), so this bug is unlikely to have real-world impact.
a356696 to
c421024
Compare
…8554) Add `eslint-plugin-stylistic` to conformance tests. 99.96% pass rate. The remaining 7 failing tests are not easily fixable: #### `jsx-props-no-multi-spaces` rule 1 failing test The rule clones nodes with `Object.assign({}, node)`, and then uses the `loc` property of the cloned node. Because `loc` is a getter on *prototype* of AST nodes, `loc` property is not present on the cloned node. This bug may have real-world impact. We'll need to make `loc` a real property of node objects to fix it (#10307). We originally had `loc` getter on the node objects themselves, but that caused a 3x slowdown. #### `jsx-tag-spacing` rule 6 failing tests TypeScript parser (which we use for generating tokens) cannot parse closing JSX tags with whitespace before the `/` - e.g. `<App>text< /App>`. TS-ESLint parser also fails to parse this [AST explorer](https://ast-explorer.dev/#eNpFyzEKwzAMBdCrGM0p3UModOkROnkRRgUH1xaWUlqC716pHbJJ7/+/Q4EZVnyhpJ5ZYQI20A/TH04kJVf3ZL5cmS+P1pZw9su0me6xhhCB0hPv1CW3GmE2KKgkGmE68huhbp3EC7+ZB6u8/de+kdOIdcD4AgUpMYU=), so this bug is unlikely to have real-world impact.
c421024 to
43eccaa
Compare

Add
eslint-plugin-stylisticto conformance tests.99.96% pass rate. The remaining 7 failing tests are not easily fixable:
jsx-props-no-multi-spacesrule1 failing test
The rule clones nodes with
Object.assign({}, node), and then uses thelocproperty of the cloned node. Becauselocis a getter on prototype of AST nodes,locproperty is not present on the cloned node.This bug may have real-world impact. We'll need to make
loca real property of node objects to fix it (#10307). We originally hadlocgetter on the node objects themselves, but that caused a 3x slowdown.jsx-tag-spacingrule6 failing tests
TypeScript parser (which we use for generating tokens) cannot parse closing JSX tags with whitespace before the
/- e.g.<App>text< /App>.TS-ESLint parser also fails to parse this (AST explorer) so this bug is unlikely to have real-world impact.