summaryrefslogtreecommitdiff
path: root/config/helpers/is_eslint.js
blob: 60528796962ec3519baa8a1fb72e9f6314aed72a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
 * Returns true if the given module is required from eslint
 */
const isESLint = (mod) => {
  let parent = mod.parent;

  while (parent) {
    if (parent.filename && parent.filename.includes('/eslint')) {
      return true;
    }

    parent = parent.parent;
  }

  return false;
};

module.exports = isESLint;