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

path-style suggests strings for arrays with non-constant values #106

Closed
Wilfred opened this issue Oct 6, 2016 · 1 comment
Closed

path-style suggests strings for arrays with non-constant values #106

Wilfred opened this issue Oct 6, 2016 · 1 comment
Milestone

Comments

@Wilfred
Copy link

Wilfred commented Oct 6, 2016

The following code produces a warning with the default lodash configuration:

function foo(x, y) {
  return _.get(x, ['bar', y, 'baz']); // Use a string for paths [lodash/path-style]
}

I don't think the warning should fire in this case. I could write _.get(x, 'bar.' + y + '.baz') (or use string interpolation in ES6) but I can't use a simple string literal in this case.

@mik01aj
Copy link

mik01aj commented Oct 7, 2016

@Wilfred agree. This also has other semantics when y contains dots.

@ganimomer ganimomer added this to the v2.0.0 milestone Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants