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

workaround for require.resolve in prettier-vscode #7951

Merged
merged 1 commit into from Apr 5, 2020

Conversation

thorn0
Copy link
Member

@thorn0 thorn0 commented Apr 4, 2020

@thorn0 thorn0 force-pushed the require-resolve-workaround branch from c1eda46 to e56d19e Compare April 4, 2020 20:36
Copy link
Sponsor Member

@fisker fisker left a comment

Choose a reason for hiding this comment

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

LGTM

const Module = eval("require")("module");
const createRequire = Module.createRequire || Module.createRequireFromPath;
resolve = createRequire(__dirname).resolve;
}
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I guess unnecessary to do another length check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure what you mean.

Copy link
Sponsor Member

@fisker fisker Apr 5, 2020

Choose a reason for hiding this comment

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

I mean do we need check resolve.length again and throw an error if length still 1, but I guess it's unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree.

@thorn0 thorn0 merged commit 6a9c995 into prettier:master Apr 5, 2020
@thorn0 thorn0 deleted the require-resolve-workaround branch July 8, 2020 22:30
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential Breaking Change in resolveConfig
2 participants