eslint-plugin-lodash icon indicating copy to clipboard operation
eslint-plugin-lodash copied to clipboard

`path-style` rule has bug

Open hikyaru-suzuki opened this issue 5 years ago • 0 comments

my code:

const obj = { a: { b: 1 }};
const a = 'a';
const b = 'b';
_.has(obj, [a, b])

I applied eslint with --fix option. path-style option is string. That result is following.

expected:

_.has(obj, `${a}.${b}`)

actually:

_.has(obj, `${a}${b}`)

packages

  • eslint: 7.4.0
  • eslint-plugin-lodash: 7.1.0

I tried several case.

a is variable. b is string.

_.has(obj, [a, 'b']);

autofix result is

_.has(obj, `${a}.b`);

a is string. b is variable.

_.has(obj, ['a', b]);

autofix result is

_.has(obj, `a${b}`);

hikyaru-suzuki avatar Jul 09 '20 14:07 hikyaru-suzuki