Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃拝 noUndeclaredDependencies reports declare module '*.extension' #2123

Closed
1 task done
ipanasenko opened this issue Mar 18, 2024 · 4 comments 路 Fixed by #2128
Closed
1 task done

馃拝 noUndeclaredDependencies reports declare module '*.extension' #2123

ipanasenko opened this issue Mar 18, 2024 · 4 comments 路 Fixed by #2128
Labels
A-Linter Area: linter S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@ipanasenko
Copy link
Contributor

Environment information

CLI:
  Version:                      1.6.1
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.19.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.2.4"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Linter:
  Recommended:                  true
  All:                          false
  Rules:                        a11y/noSvgWithoutTitle = "off"
                                a11y/useKeyWithClickEvents = "off"
                                a11y/useKeyWithMouseEvents = "off"
                                a11y/useValidAnchor = "off"
                                complexity/noUselessLoneBlockStatements = "error"
                                correctness/noInvalidUseBeforeDeclaration = "off"
                                correctness/noNewSymbol = "error"
                                correctness/noUnusedPrivateClassMembers = "error"
                                correctness/noUnusedVariables = "error"
                                correctness/useExhaustiveDependencies = "off"
                                correctness/useHookAtTopLevel = "error"
                                nursery/noDoneCallback = "error"
                                nursery/noExportsInTest = "error"
                                nursery/noSemicolonInJsx = "error"
                                nursery/noUndeclaredDependencies = "error"
                                nursery/noUselessTernary = "error"
                                performance/noDelete = "off"
                                style/noNegationElse = "error"
                                style/noNonNullAssertion = "off"
                                style/noRestrictedGlobals = "error"
                                style/noShoutyConstants = "error"
                                style/noUnusedTemplateLiteral = "off"
                                style/useBlockStatements = "error"
                                style/useCollapsedElseIf = "error"
                                style/useForOf = "error"
                                style/useImportType = "off"
                                style/useNodejsImportProtocol = "error"
                                style/useNumberNamespace = "error"
                                style/useShorthandAssign = "error"
                                style/useShorthandFunctionType = "error"
                                style/useSingleCaseStatement = "error"
                                suspicious/noConsoleLog = "error"
                                suspicious/noRedeclare = "off"

Workspace:
  Open Documents:               0

Rule name

lint/nursery/noUndeclaredDependencies

Playground link

none

Expected result

Does not report declare module '*.whatever' in .d.ts files

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@Sec-ant
Copy link
Contributor

Sec-ant commented Mar 18, 2024

I think this can be considered as a duplicate of #2074.

I was being too rush. It seems like another issue as clarified in #2123 (comment)

@ipanasenko ipanasenko changed the title 馃拝 noUndeclaredDependencies reports declare module '*.png' 馃拝 noUndeclaredDependencies reports declare module '*.extension' Mar 18, 2024
@arendjr
Copy link
Contributor

arendjr commented Mar 18, 2024

I think this may need some clarification. @ipanasenko did you declare modules somewhere inside .d.ts files and now you want those modules to be considered declared, so you can import them elsewhere? If so, I agree your best solution is the suggested allowlist in #2074, at least for the time being.

Or did you mean you get a diagnostic in the declare module statement in a .d.ts file itself? If so, that would be a separate issue.

@arendjr arendjr added the S-Needs response Status: await response from OP label Mar 18, 2024
@ipanasenko
Copy link
Contributor Author

ipanasenko commented Mar 18, 2024

Sorry, including screenshot. I want to tell TS that it's okay to import .png and .scss files:

image

@arendjr
Copy link
Contributor

arendjr commented Mar 18, 2024

Right, gotcha. I think noUndeclaredDependencies should indeed not apply to these at all.

@arendjr arendjr added A-Linter Area: linter S-Bug-confirmed Status: report has been confirmed as a valid bug and removed S-Needs response Status: await response from OP labels Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants