title: eslint can't find OnInit from "@angular/core"
body: <p>this gives an error:</p>
  <pre><code>import { Component, OnInit, Input, ViewChild, ElementRef } from &quot;@angular/core&quot;;
  </code></pre>
  <blockquote>
  <p>OnInit not found in '@angular/core'eslintimport/named</p>
  </blockquote>
  <p>The code obviously works, so maybe something in my setup is off?</p>
  <p>This is my eslint:</p>
  <pre><code>const path = require('path')
  
  module.exports = {
    extends: getExtends(),
    plugins: getPlugins(),
    rules: getRules(),
    parserOptions: getParserOptions(),
    parser: '@typescript-eslint/parser',
    env: getEnv(),
    settings: getSettings(),
  }
  
  function getExtends() {
    return [
      'eslint:recommended',
      'plugin:import/errors',
      'plugin:import/warnings',
      'plugin:@typescript-eslint/recommended',
    ]
  }
  
  function getPlugins() {
    return ['import', '@typescript-eslint', 'cypress']
  }
  
  function getRules() {
    return {
      &quot;@typescript-eslint/no-empty-function&quot;: 0,
      '@typescript-eslint/ban-ts-comment': 0,
      '@typescript-eslint/explicit-module-boundary-types': 0,
      '@typescript-eslint/no-explicit-any': 0,
      '@typescript-eslint/no-unsafe-member-access': 0,
      '@typescript-eslint/no-unsafe-call': 0,
      '@typescript-eslint/no-unsafe-assignment': 0,
      'no-unused-vars': 0,
      'import/no-anonymous-default-export': 0,
      'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
      'import/no-named-as-default': 0,
      'import/no-named-as-default-member': 0,
      'prefer-const': 2,
      'no-var': 2,
      '@typescript-eslint/no-unused-vars': [
        'error',
        { vars: 'all', args: 'after-used', ignoreRestSiblings: true },
      ],
      'import/order': [
        'error',
        {
          groups: [
            'builtin',
            'external',
            'internal',
            'index',
            'sibling',
            'parent',
          ],
          'newlines-between': 'always',
        },
      ],
    }
  }
  
  function getParserOptions() {
    return {
      ecmaVersion: 12,
      project: [path.resolve(__dirname, 'tsconfig.json')],
    }
  }
  
  function getEnv() {
    return {
      es2021: true,
    }
  }
  
  function getSettings() {
    return {
      'import/parsers': {
        '@typescript-eslint/parser': ['.ts'],
      },
      'import/resolver': {
        node: {
          extensions: ['.js', '.ts'],
        },
      },
    }
  }
  
  </code></pre>
  <p>and my tsconfig:</p>
  <pre><code>{
    &quot;compileOnSave&quot;: false,
    &quot;compilerOptions&quot;: {
      &quot;allowSyntheticDefaultImports&quot;: true,
      &quot;baseUrl&quot;: &quot;./&quot;,
      &quot;paths&quot;: {
        &quot;@ch-common/*&quot;: [&quot;src/app/ch-common/*&quot;],
        &quot;@ch-corporate-orders/*&quot;: [&quot;src/app/corporate-orders/*&quot;],
        &quot;@ch-time-scheduler/*&quot;: [&quot;src/app/time-scheduler/*&quot;],
        &quot;@ch-products/*&quot;: [&quot;src/app/products/*&quot;],
        &quot;@ch-events/*&quot;: [&quot;src/app/events/*&quot;],
        &quot;@ch-forms/*&quot;: [&quot;src/app/forms/*&quot;],
        &quot;@ch-checkout/*&quot;: [&quot;src/app/checkout/*&quot;],
        &quot;@ch-wine-club/*&quot;: [&quot;src/app/wine-club/*&quot;],
        &quot;@ch-containers/*&quot;: [&quot;src/app/containers/*&quot;],
        &quot;@ch-product-offers/*&quot;: [&quot;src/app/product-offers/*&quot;],
        &quot;@ch-search-box/*&quot;: [&quot;src/app/search-box/*&quot;],
        &quot;@ch-store-reviews/*&quot;: [&quot;src/app/store-reviews/*&quot;],
        &quot;@ch-cart/*&quot;: [&quot;src/app/cart/*&quot;],
        &quot;@ch-profile-page/*&quot;: [&quot;src/app/profile-page/*&quot;],
        &quot;@ch-shared/*&quot;: [&quot;src/app/ch-shared/*&quot;],
        &quot;@ch-hivenet-objects/*&quot;: [&quot;../app/scripts/hivenet/objects/*&quot;],
        &quot;@ch-tests/*&quot;: [&quot;src/test_helpers/*&quot;]
      },
      &quot;outDir&quot;: &quot;./dist/out-tsc&quot;,
      &quot;sourceMap&quot;: true,
      &quot;declaration&quot;: false,
      &quot;downlevelIteration&quot;: true,
      &quot;experimentalDecorators&quot;: true,
      &quot;module&quot;: &quot;es2020&quot;,
      &quot;moduleResolution&quot;: &quot;node&quot;,
      &quot;importHelpers&quot;: true,
      &quot;target&quot;: &quot;es2015&quot;,
      &quot;typeRoots&quot;: [&quot;node_modules/@types&quot;],
      &quot;lib&quot;: [&quot;es2019&quot;, &quot;dom&quot;]
    },
    &quot;angularCompilerOptions&quot;: {
      &quot;fullTemplateTypeCheck&quot;: true,
      &quot;strictInjectionParameters&quot;: true
    }
  }
  
  </code></pre>