2020-05-15 17:08:21 -04:00
|
|
|
/**
|
|
|
|
* Returns true if the given module is required from eslint
|
|
|
|
*/
|
2020-12-23 16:10:24 -05:00
|
|
|
const isESLint = (mod) => {
|
2021-03-10 10:09:11 -05:00
|
|
|
let { parent } = mod;
|
2020-05-15 17:08:21 -04:00
|
|
|
|
|
|
|
while (parent) {
|
2020-08-24 08:10:17 -04:00
|
|
|
if (parent.filename && parent.filename.includes('/eslint')) {
|
2020-05-15 17:08:21 -04:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
parent = parent.parent;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = isESLint;
|