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