Skip to content
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

feat: add physicalFilename property to the rule context #17111

Merged
merged 6 commits into from Apr 29, 2023

Conversation

snitin315
Copy link
Contributor

@snitin315 snitin315 commented Apr 23, 2023

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

Refers #16999

This PR creates context.physicalFilename and deprecates context.getPhysicalFilename().

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

Did I miss any references?

@snitin315 snitin315 requested a review from a team as a code owner April 23, 2023 04:02
@eslint-github-bot eslint-github-bot bot added the feature This change adds a new feature to ESLint label Apr 23, 2023
@netlify
Copy link

netlify bot commented Apr 23, 2023

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit 012acae
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/644cf7a87959a00007785f4a

@snitin315 snitin315 mentioned this pull request Apr 23, 2023
39 tasks
docs/src/extend/custom-rules.md Outdated Show resolved Hide resolved
tests/lib/linter/linter.js Show resolved Hide resolved
@snitin315 snitin315 force-pushed the feat/context-physicalFilename branch from 4e9a30a to bf183f9 Compare April 27, 2023 14:19
docs/src/extend/custom-rules.md Outdated Show resolved Hide resolved
@snitin315 snitin315 added the accepted There is consensus among the team that this change meets the criteria for inclusion label Apr 29, 2023
@snitin315 snitin315 force-pushed the feat/context-physicalFilename branch from bf183f9 to 0a8d71e Compare April 29, 2023 09:43
@@ -6757,7 +6761,7 @@ var a = "test2";
create: context => ({
Program(ast) {
receivedFilenames.push(context.filename);
receivedPhysicalFilenames.push(context.getPhysicalFilename());
receivedPhysicalFilenames.push(context.physicalFilename);
Copy link
Member

Choose a reason for hiding this comment

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

It would be good to add assert.strictEqual(context.getFilename(), context.filename) and assert.strictEqual(context.getPhysicalFilename(), context.physicalFilename) here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mdjermanovic Added 👍🏻

tests/lib/linter/linter.js Show resolved Hide resolved
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit 1468f5b into main Apr 29, 2023
22 checks passed
@mdjermanovic mdjermanovic deleted the feat/context-physicalFilename branch April 29, 2023 11:16
@aladdin-add aladdin-add restored the feat/context-physicalFilename branch June 14, 2023 06:25
aladdin-add pushed a commit to aladdin-add/eslint that referenced this pull request Jun 15, 2023
aladdin-add added a commit to aladdin-add/eslint that referenced this pull request Jun 15, 2023
aladdin-add added a commit to aladdin-add/eslint that referenced this pull request Jun 15, 2023
aladdin-add added a commit to aladdin-add/eslint that referenced this pull request Jun 15, 2023
aladdin-add added a commit to aladdin-add/eslint that referenced this pull request Jun 15, 2023
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Oct 27, 2023
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion feature This change adds a new feature to ESLint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants