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

lodash/prefer-lodash-method doesn't check real lodash

Open affinage-digital opened this issue 6 years ago • 0 comments

My code

...
const getCookie = name => {
    const nameEQ = name + '=';
    const ca = _.split(document.cookie, ';');
    let result = null;

    _.each(ca, c => {
        const char = _.trim(c);

        if (_.startsWith(char, nameEQ)) {
            result = char.substring(nameEQ.length, c.length);
        }
    });

    return result;
};
...

My errors

C:\***\src\include\grid\grid.js
13:16  error  Prefer '_.split' over the native function       lodash/prefer-lodash-method
17:22  error  Prefer '_.trim' over the native function        lodash/prefer-lodash-method
19:13  error  Prefer '_.startsWith' over the native function  lodash/prefer-lodash-method

affinage-digital avatar Apr 15 '19 10:04 affinage-digital