title: Why am I getting "Definition for rule 'import/no-extraneous-dependencies' was not found" when running ESLint?
body: <p>I'm working on an Electron app with React and I'm using Typescript, Webpack, Babel and ESLint. And for some reason I get in my <strong>main.js</strong> file, which is my bundled file, the following line:</p>
  <pre><code>try {
      // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
      // eslint-disable-next-line import/no-extraneous-dependencies
      const supportsColor = __webpack_require__(/*! supports-color */ &quot;./node_modules/supports-color/index.js&quot;);
  
      if (supportsColor &amp;&amp; (supportsColor.stderr || supportsColor).level &gt;= 2) {
          exports.colors = [
  </code></pre>
  <p>Which triggers the following error when I run <code>npm run lint</code>:</p>
  <pre><code>&gt; biomech@1.0.0 lint
  &gt; eslint .
  
  
  /Users/lucas_sg/Documents/pf-biomech/dist/main.js
    2946:2  error  Definition for rule 'import/no-extraneous-dependencies' was not found  import/no-extraneous-dependencies
  
  ✖ 1 problem (1 error, 0 warnings)
  
  npm ERR! code 1
  npm ERR! path /Users/lucas_sg/Documents/pf-biomech
  npm ERR! command failed
  npm ERR! command sh -c eslint .
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /Users/lucas_sg/.npm/_logs/2021-01-29T22_56_39_247Z-debug.log
  </code></pre>
  <p>And when I check out the log I don't feel like I know more about how to debug the error:</p>
  <pre><code>0 verbose cli [
  0 verbose cli   '/usr/local/Cellar/node/15.6.0/bin/node',
  0 verbose cli   '/usr/local/bin/npm',
  0 verbose cli   'run',
  0 verbose cli   'lint'
  0 verbose cli ]
  1 info using npm@7.4.0
  2 info using node@v15.6.0
  3 timing config:load:defaults Completed in 2ms
  4 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
  5 timing config:load:builtin Completed in 1ms
  6 timing config:load:cli Completed in 2ms
  7 timing config:load:env Completed in 0ms
  8 timing config:load:file:/Users/lucas_sg/Documents/pf-biomech/.npmrc Completed in 0ms
  9 timing config:load:project Completed in 1ms
  10 timing config:load:file:/Users/lucas_sg/.npmrc Completed in 0ms
  11 timing config:load:user Completed in 0ms
  12 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
  13 timing config:load:global Completed in 0ms
  14 timing config:load:cafile Completed in 0ms
  15 timing config:load:validate Completed in 0ms
  16 timing config:load:setUserAgent Completed in 0ms
  17 timing config:load:setEnvs Completed in 1ms
  18 timing config:load Completed in 8ms
  19 verbose npm-session 3273db6630b48789
  20 timing npm:load Completed in 16ms
  21 timing command:run-script Completed in 1117ms
  22 verbose stack Error: command failed
  22 verbose stack     at ChildProcess.&lt;anonymous&gt; (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
  22 verbose stack     at ChildProcess.emit (node:events:379:20)
  22 verbose stack     at maybeClose (node:internal/child_process:1065:16)
  22 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:296:5)
  23 verbose pkgid biomech@1.0.0
  24 verbose cwd /Users/lucas_sg/Documents/pf-biomech
  25 verbose Darwin 20.2.0
  26 verbose argv &quot;/usr/local/Cellar/node/15.6.0/bin/node&quot; &quot;/usr/local/bin/npm&quot; &quot;run&quot; &quot;lint&quot;
  27 verbose node v15.6.0
  28 verbose npm  v7.4.0
  29 error code 1
  30 error path /Users/lucas_sg/Documents/pf-biomech
  31 error command failed
  32 error command sh -c eslint .
  33 verbose exit 1
  </code></pre>
  <p>My <strong>.eslintrc</strong> file is:</p>
  <pre><code>{
      &quot;parserOptions&quot;: {
          &quot;ecmaVersion&quot;: 7,
          &quot;sourceType&quot;: &quot;module&quot;,
          &quot;ecmaFeatures&quot;: {
              &quot;jsx&quot;: true
          }
      }
  }
  </code></pre>
  <p>And my <strong>package.json</strong> in case it's useful:</p>
  <pre><code>{
    &quot;name&quot;: &quot;Electron app&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;&quot;,
    &quot;main&quot;: &quot;./dist/main.js&quot;,
    &quot;preload&quot;: &quot;./dist/preload.js&quot;,
    &quot;scripts&quot;: {
      &quot;dev&quot;: &quot;concurrently --success first \&quot;npm run dev:electron\&quot; \&quot;npm run dev:react\&quot; -k&quot;,
      &quot;dev:electron&quot;: &quot;NODE_ENV=development webpack --config webpack.electron.config.js --mode development &amp;&amp; electron .&quot;,
      &quot;dev:react&quot;: &quot;NODE_ENV=development webpack serve --config webpack.react.config.js --mode development&quot;,
      &quot;build:electron&quot;: &quot;NODE_ENV=production webpack --config webpack.electron.config.js --mode production&quot;,
      &quot;build:react&quot;: &quot;NODE_ENV=production webpack --config webpack.react.config.js --mode production&quot;,
      &quot;build&quot;: &quot;npm run build:electron &amp;&amp; npm run build:react&quot;,
      &quot;pack&quot;: &quot;electron-builder --dir&quot;,
      &quot;dist&quot;: &quot;electron-builder&quot;,
      &quot;lint&quot;: &quot;eslint .&quot;,
      &quot;format&quot;: &quot;prettier --write \&quot;**/*.+(js|jsx|json|yml|yaml|css|md|vue)\&quot;&quot;
    },
    &quot;keywords&quot;: [],
    &quot;license&quot;: &quot;MIT&quot;,
    &quot;build&quot;: {
      &quot;files&quot;: [
        &quot;dist/&quot;,
        &quot;node_modules/&quot;,
        &quot;package.json&quot;
      ],
      &quot;productName&quot;: &quot;Biomech&quot;,
      &quot;appId&quot;: &quot;com.example.app&quot;,
      &quot;directories&quot;: {
        &quot;output&quot;: &quot;dist&quot;
      }
    },
    &quot;devDependencies&quot;: {
      &quot;@babel/preset-env&quot;: &quot;^7.9.5&quot;,
      &quot;@babel/preset-react&quot;: &quot;^7.9.4&quot;,
      &quot;@babel/preset-typescript&quot;: &quot;^7.9.0&quot;,
      &quot;@types/electron-devtools-installer&quot;: &quot;^2.2.0&quot;,
      &quot;@types/react-router-dom&quot;: &quot;^5.1.7&quot;,
      &quot;@types/regenerator-runtime&quot;: &quot;^0.13.0&quot;,
      &quot;dpdm&quot;: &quot;^3.6.0&quot;,
      &quot;electron&quot;: &quot;^11.2.1&quot;,
      &quot;electron-builder&quot;: &quot;^22.7.0&quot;,
      &quot;electron-devtools-installer&quot;: &quot;^3.1.1&quot;,
      &quot;eslint&quot;: &quot;^7.18.0&quot;,
      &quot;file-loader&quot;: &quot;^6.2.0&quot;,
      &quot;html-webpack-plugin&quot;: &quot;^4.5.1&quot;,
      &quot;husky&quot;: &quot;^4.3.8&quot;,
      &quot;lint-staged&quot;: &quot;^10.5.3&quot;,
      &quot;prettier&quot;: &quot;^2.2.1&quot;,
      &quot;react-router-dom&quot;: &quot;^5.2.0&quot;,
      &quot;webpack&quot;: &quot;^5.11.1&quot;,
      &quot;webpack-cli&quot;: &quot;^4.3.1&quot;,
      &quot;webpack-dev-server&quot;: &quot;^3.11.1&quot;
    },
    &quot;dependencies&quot;: {
      &quot;@babel/core&quot;: &quot;^7.12.10&quot;,
      &quot;@popperjs/core&quot;: &quot;^2.6.0&quot;,
      &quot;@types/node&quot;: &quot;^14.14.22&quot;,
      &quot;@types/react&quot;: &quot;^17.0.0&quot;,
      &quot;@types/react-dom&quot;: &quot;^17.0.0&quot;,
      &quot;axios&quot;: &quot;^0.21.1&quot;,
      &quot;babel-loader&quot;: &quot;^8.2.2&quot;,
      &quot;bootstrap&quot;: &quot;^4.5.3&quot;,
      &quot;chokidar&quot;: &quot;^3.5.1&quot;,
      &quot;core-js&quot;: &quot;^3.8.3&quot;,
      &quot;css-loader&quot;: &quot;^5.0.1&quot;,
      &quot;electron-fetch&quot;: &quot;^1.7.3&quot;,
      &quot;fsevents&quot;: &quot;^2.3.1&quot;,
      &quot;ini&quot;: &quot;^2.0.0&quot;,
      &quot;jquery&quot;: &quot;^3.5.1&quot;,
      &quot;react&quot;: &quot;^17.0.1&quot;,
      &quot;react-bootstrap&quot;: &quot;^1.4.0&quot;,
      &quot;react-dom&quot;: &quot;^17.0.1&quot;,
      &quot;react-google-login&quot;: &quot;^5.2.2&quot;,
      &quot;style-loader&quot;: &quot;^2.0.0&quot;
    },
    &quot;husky&quot;: {
      &quot;hooks&quot;: {
        &quot;pre-commit&quot;: &quot;npm run lint &amp;&amp; npm run format&quot;
      }
    },
    &quot;lint-staged&quot;: {
      &quot;*.+(js|jsx)&quot;: &quot;eslint --fix&quot;,
      &quot;*.+(json|css|md)&quot;: &quot;prettier --write&quot;
    }
  }
  </code></pre>
  <p>I don't know where the <code>eslint-disable-next-line import/no-extraneous-dependencies</code> line is coming from. If it's from Webpack, or Babel, or something else. But I don't think I actually need it since I never even typed a rule regarding extraneous dependencies. I tried adding an empty rule to the <strong>.eslintrc</strong> just so that it would at least make sense but I couldn't find anything regarding <strong>no-extraneous-dependencies</strong> in the ESLint docs, so I could never add it.</p>