Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

import/no-internal-modules is warn/error for relative paths #205

Open
stefan-schweiger opened this issue Mar 18, 2021 · 0 comments
Open

Comments

@stefan-schweiger
Copy link

As soon as I use this package with an active import/no-internal-modules configuration I'm getting warn/error messages for relative path imports.

"import/no-internal-modules": [
  "error",
  {
    "allow": [
      "@angular/*",
      "@angular/cdk/*",
      "@angular/material/*",
      "@angular/platform-browser/*",
      "@angular/**/testing",
      "@backend/*",
      "@frontend/*"
    ]
  }
],

The config above without eslint-config-airbnb-typescript only shows error when I'm importing a not specified submodule.

import { Component } from @angular/core; // works
import * from @angular/localize/init; // error as expected
import { Test } from './test-helper' // works
import { TestParent } from '../parent-test-helper' // works

But as soon as I use eslint-config-airbnb-typescript this is the result:

import { Component } from @angular/core; // works
import * from @angular/localize/init; // error as expected
import { Test } from './test-helper' // error but should work
import { TestParent } from '../parent-test-helper' // error but should work

I've also tried to add patterns to mitigate this but this also did nothing for me:

"allow": [
   // ...
  "./*",
  "./**/*",
  "../*",
  "../**/*",
]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant