eslint-plugin-lodash
eslint-plugin-lodash copied to clipboard
lodash/prefer-lodash-method doesn't check real lodash
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