debian-mirror-gitlab/config/helpers/is_eslint.js
2021-04-17 20:07:23 +05:30

18 lines
312 B
JavaScript

/**
* Returns true if the given module is required from eslint
*/
const isESLint = (mod) => {
let { parent } = mod;
while (parent) {
if (parent.filename && parent.filename.includes('/eslint')) {
return true;
}
parent = parent.parent;
}
return false;
};
module.exports = isESLint;