Yarn: Emoji disabled

Created on 14 Sep 2017  Â·  12Comments  Â·  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?

bug
What is the current behavior?
The only way to see emoji is to explicitly pass --emoji to yarn. It would seem the line emoji true in .yarnrc is ignored (as are variations like --emoji, no-emoji false, etc).

rasmus ⇒ yarn config list        
yarn config v1.0.1
info yarn config
{ 'version-tag-prefix': 'v',
  'version-git-tag': true,
  'version-git-sign': false,
  'version-git-message': 'v%s',
  'init-version': '1.0.0',
  'init-license': 'MIT',
  'save-prefix': '^',
  'ignore-scripts': false,
  'ignore-optional': false,
  registry: 'https://registry.yarnpkg.com',
  'strict-ssl': true,
  'user-agent': 'yarn/1.0.1 npm/? node/v8.4.0 linux x64',
  emoji: true,
  lastUpdateCheck: 1505388775752,
  prefix: '/home/rasmus/.nvm/versions/node/v8.4.0' }
info npm config
{}

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?
Emoji would be displayed since they are turned on.

Please mention your node.js, yarn and operating system version.
yarn 1.0.1
node 8.4.1
ubuntu 16.04

triaged

Most helpful comment

So:

  • echo '--emoji true' >> ~/.yarnrc
  • echo 'emoji true' >> ~/.yarnrc
  • echo '"emoji" true' >> ~/.yarnrc

All these variants dIdn't work for me. But:

  • echo '"--emoji" true' >> ~/.yarnrc

Did work successfully for me, so that my final ~/.yarnrc looked like that:

# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
lastUpdateCheck 1534863078846
"--emoji" true

Hope this help you guys!

Tested & working on Linux archlinux 4.18.3-arch1-1-ARCH x86_64.

All 12 comments

Would you be willing to submit a PR?

Sure, I can look at it over the weekend.

@axit-rasmus I'm unable to reproduce this locally on 1.0.2 and node v8.4.0

@BYK I'm not privy to the config settings, but are some keys wrapped in single quotes and others not by design?

screen shot 2017-09-17 at 5 15 06 pm

@BYK I'm not privy to the config settings, but are some keys wrapped in single quotes and others not by design?

Yup. This is a JavaScript object so quoted ones are strings, others are numbers or booleans erc.

@BYK

Yup. This is a JavaScript object so quoted ones are strings, others are numbers or booleans erc.

Hmm ... this seems like inconsistent behavior. ignore-scripts is a boolean that is wrapped in single quotes, yet emoji is not. I would think all keys would be strings with consistent formatting, but (as you can see in my output) registry, emoji, and lastUpdateCheck are not

EDIT for clarification:

@BYK I'm not privy to the config settings, but are some keys wrapped in single quotes and others not by design?

** Object keys

That is simply a javascript quirk, since - unquoted means subtraction. It happens when you print an object with kebab-case keys. I'm pretty sure this has nothing to do with the issue.
I'll try to figure out how yarn exactly decides to turn them off, maybe it's an environment thing.

@axit-rasmus Sorry to hijack your thread! Opening a different issue

Actually --emoji true should work.

It won't. Sorry I got confused :(

This is due to a discrepancy of how we add options from .yarnrc and how commander parses it. I'll try to get it fixed. It's not only --emoji, this affects some other arguments too.

For those who end up here later, you can enable emoji the following ways:

as a global (per machine) configuration: ~/.yarnrc

--emoji true

as a local project configuration (carries with repo): /path/to/project/.yarnrc

--emoji true

Because of the way the configuration for this flag works, there is no way to use the $ yarn config command AFAIK.

So:

  • echo '--emoji true' >> ~/.yarnrc
  • echo 'emoji true' >> ~/.yarnrc
  • echo '"emoji" true' >> ~/.yarnrc

All these variants dIdn't work for me. But:

  • echo '"--emoji" true' >> ~/.yarnrc

Did work successfully for me, so that my final ~/.yarnrc looked like that:

# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
lastUpdateCheck 1534863078846
"--emoji" true

Hope this help you guys!

Tested & working on Linux archlinux 4.18.3-arch1-1-ARCH x86_64.

Was this page helpful?
0 / 5 - 0 ratings