Skip to content

Remove eval() call from the bundle#6129

Merged
duailibe merged 3 commits intoprettier:masterfrom
duailibe:remove-eval
May 17, 2019
Merged

Remove eval() call from the bundle#6129
duailibe merged 3 commits intoprettier:masterfrom
duailibe:remove-eval

Conversation

@duailibe
Copy link
Copy Markdown
Collaborator

The TOML parser has a eval("require('util')").inspect in the code, which makes Prettier fail when loading in some environments. We'll replace it for require("util").inspect in the bundle.

Fixes #6053

@duailibe
Copy link
Copy Markdown
Collaborator Author

Should we add this to the CHANGELOG? If so, can you help me how to phrase it?

@lydell
Copy link
Copy Markdown
Member

lydell commented May 16, 2019

Something like this, maybe?

Prettier now works when run inside the Atom editor again. Atom has a security feature where code containing eval is not allowed to be run. One of Prettier's dependencies uses eval to prevent bundlers from including debug code. We've now made sure that this eval does not end up in the code we ship to npm, making Prettier play nice with Atom again.

@duailibe duailibe merged commit bb1fd59 into prettier:master May 17, 2019
@duailibe duailibe deleted the remove-eval branch May 17, 2019 13:21
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Aug 15, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unsafe Eval Causing Problems in Prettier-Atom After 1.17

2 participants