Skip to content

fix: update the rule-tester import in rule test template#202

Merged
nzakas merged 1 commit into
eslint:mainfrom
Amnish04:fix-core-rule-template
Jul 1, 2025
Merged

fix: update the rule-tester import in rule test template#202
nzakas merged 1 commit into
eslint:mainfrom
Amnish04:fix-core-rule-template

Conversation

@Amnish04

@Amnish04 Amnish04 commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

I was trying to use this generator today for implementing a new rule in ESLint core, and ran across a bug where the import in the generator rule test file could not be resolved.

I realized the correct import is

require("../../../lib/rule-tester")

unlike what was generated (like the following)

require("../../../lib/testers/rule-tester")

In this PR, I have corrected the import so it reflects the latest tree structure of eslint/eslint and updated the corresponding tests to expect the new import.

I also tried to generate a new rule using my local version of generator-eslint and it seems to work well for me.

Note: I did not file an issue because the guidelines suggest that bug fixes do not require one.

@eslint-github-bot eslint-github-bot Bot added the bug label Jul 1, 2025
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 1, 2025

Copy link
Copy Markdown

CLA Signed


The committers listed above are authorized under a signed CLA.

@aladdin-add

Copy link
Copy Markdown
Member

can you sign the cla, please?

@Amnish04

Amnish04 commented Jul 1, 2025

Copy link
Copy Markdown
Contributor Author

@aladdin-add Sure, just signed the CLA!

@aladdin-add aladdin-add left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Would like another review before merging.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage Jul 1, 2025
@aladdin-add aladdin-add moved this from Needs Triage to Second Review Needed in Triage Jul 1, 2025

@nzakas nzakas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks.

@nzakas nzakas merged commit 9bcd275 into eslint:main Jul 1, 2025
11 checks passed
@github-project-automation github-project-automation Bot moved this from Second Review Needed to Complete in Triage Jul 1, 2025
@github-actions github-actions Bot mentioned this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

3 participants