Skip to content

test: replace deprecated rules in processor tests - #767

Open
lumirlumir wants to merge 1 commit into
mainfrom
test/replace-deprecated-rules-in-processor-tests
Open

lumirlumir wants to merge 1 commit into
mainfrom
test/replace-deprecated-rules-in-processor-tests

Conversation

@lumirlumir

@lumirlumir lumirlumir commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Prerequisites checklist

AI acknowledgment

Check all that apply.

  • I did not use AI to generate this PR.
  • I used AI to write or edit the description of this PR (including translation).
  • I used AI to understand the codebase.
  • I used AI to write or edit the files in this PR and I reviewed the files.

What is the purpose of this pull request?

In this PR, I replaced deprecated rules in the processor tests with non-deprecated alternatives.

Those deprecated rules are scheduled for removal (like the references below), so if they are removed in the future the tests may no longer behave as expected.

https://github.com/eslint/eslint/blob/eafd727a060131f7fc79b2eb5698d8d27683c3a2/lib/rules/quotes.js#L104

I've tried to preserve the original intent of the test code and minimize the git diff.

What changes did you make? (Give an overview)

In this PR, I replaced deprecated rules in the processor tests with non-deprecated alternatives.

Related Issues

eslint/eslint#20406

Is there anything you'd like reviewers to focus on?

N/A

Summary by CodeRabbit

  • Tests
    • Updated linting test coverage for Yoda conditions, dot notation, configuration comments, and unused disable directives.
    • Expanded checks for autofixes and reported issues across Markdown code blocks, nested layouts, multiline expressions, and line-ending formats.
    • Revised processor test cases to verify updated diagnostic messages, locations, and fix ranges.

@eslintbot eslintbot added this to Triage Nov 25, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage Nov 25, 2026
@lumirlumir
lumirlumir marked this pull request as ready for review November 25, 2026 03:21
@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The changes update test fixtures and expectations for ESLint rules, Markdown directive parsing, plugin linting and autofixing, and processor postprocessing. No production code changes are described.

Changes: Lint test updates

Layer / File(s) Summary
Rule fixtures and directive parsing
tests/fixtures/eslint.config.js, tests/fixtures/eslintrc.json, tests/fixtures/long.md, tests/language/markdown-source-code.test.js
Fixtures use dot-notation and Yoda examples. Markdown directive expectations change from semi to yoda.
Plugin lint and autofix expectations
tests/plugin.test.js
LegacyESLint and FlatESLint cases replace quote and semicolon examples with Yoda conditions, dot-notation, and unused-label cases. Leading-empty-lines expectations change to no-restricted-syntax.
Processor postprocessing expectations
tests/processor.test.js
Tests update configuration comments and fixtures. Expected diagnostics, columns, and fix ranges change to match the revised fixtures.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Suggested reviewers: nzakas, mdjermanovic, btmills

Merge Risk: Minimal · up to 5e8f5

This PR replaces deprecated rules in test fixtures and expectations with non-deprecated ones and does not change shipped behavior. Merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change: replacing deprecated ESLint rules in the processor tests. The raw summary confirms processor.test.js swaps quotes and other deprecated-rule cases for Yoda, eqeqeq, and no-a…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: replacing deprecated ESLint rules in the processor tests. The raw summary confirms processor.test.js swaps quotes and other deprecated-rule cases for Yoda, eqeqeq, and no-alert cases. The title is specific and matches the main change. It omits the fixture and plugin test updates, which is acceptable.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7e75b7c6-3869-4a36-9408-466ec3f9277a
Commits

Reviewing files that changed from the base of the PR and between e3ce918 and 5e8f529.

Files selected for processing: 6

  • tests/fixtures/eslint.config.js
  • tests/fixtures/eslintrc.json
  • tests/fixtures/long.md
  • tests/language/markdown-source-code.test.js
  • tests/plugin.test.js
  • tests/processor.test.js

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread tests/plugin.test.js
"",
"```js",
"var single = 'single';",
"var single = 1 === window.length;",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

single / double are leftovers from the quotes version of this test. Maybe literalFirst / literalLast?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants