debian-mirror-gitlab/config/helpers/is_eslint.js

19 lines
312 B
JavaScript
Raw Normal View History

2020-05-24 23:13:21 +05:30
/**
* Returns true if the given module is required from eslint
*/
2021-03-08 18:12:59 +05:30
const isESLint = (mod) => {
2021-04-17 20:07:23 +05:30
let { parent } = mod;
2020-05-24 23:13:21 +05:30
while (parent) {
2020-11-24 15:15:51 +05:30
if (parent.filename && parent.filename.includes('/eslint')) {
2020-05-24 23:13:21 +05:30
return true;
}
parent = parent.parent;
}
return false;
};
module.exports = isESLint;