Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug: [no-restricted-imports] allowTypeImports should allow inline type qualifiers #7374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
aaronadamsCA opened this issue Jul 29, 2023 · 2 comments · Fixed by #7379
Closed
4 tasks done
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@aaronadamsCA
Copy link

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=4.9.5&showAST=es&fileType=.tsx&code=KYDwDg9gTgLgBAbzjAnmYcBiEJwL5wBmUEAtnAOQCWpksAtIThQNxA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1uhXyrPyIAJrUoBbYh2j5UGANrhsORNGhTIAGkVKsS7JGIBDfAAtZYBXr26rSyE0NjE6KOMnTaAMw4dN22ziG8PAcAO4AKiSIAJISUjIufLCI-lYAvqnYALqZGUo5EBlpQA&tsconfig=N4XyA&tokens=false

Repro Code

export { type Foo } from 'import-foo';

ESLint Config

module.exports = {
  "rules": {
    "@typescript-eslint/no-restricted-imports": [
      "error",
      {
        "paths": [
          {
            "name": "import-foo",
            "allowTypeImports": true
          }
        ]
      }
    ]
  }
}

tsconfig

{}

Expected Result

No error.

Actual Result

'import-foo' import is restricted from being used.

Additional Info

No response

@aaronadamsCA aaronadamsCA added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Jul 29, 2023
@aaronadamsCA
Copy link
Author

This might actually be a feature request, but it's way easier to create a bug report using the playground, so you get a bug report. 😅

@bradzacher
Copy link
Member

I think it makes sense to allow export from as long as every single specifier uses an inline type qualifier!

@bradzacher bradzacher added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Jul 29, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
2 participants