Skip to content

imports-as-dependencies: prints error on missing package.json even if not active #1117

Closed
@g1thuser

Description

@g1thuser

Expected behavior

No error output on missing package.json at least if it is not active

Actual behavior

An error is always printed, if package.json is not found although imports-as-dependencies is not configured. Although the error is catched and only printed it breaks parsing the eslint output.

A similar issue is reported here. As this was not fixed so far I implemented a workaround to create an empty package.json in the parent folder of all my projects. This works for eslint-plugin-import but not for eslint-plugin-jsdoc as eslint-plugin-jsdoc is only looking in the current working directory for package.json.

ESLint Config

{
  plugins: ["jsdoc"],
  rules: {
    "jsdoc/check-access": "error",
    "jsdoc/check-alignment": "error",
    "jsdoc/check-indentation": "error",
    "jsdoc/check-param-names": "error",
     ... (*)
  }
}

(*) but not "jsdoc/imports-as-dependencies": "error",

Environment

  • Node version: 20.2.0
  • ESLint version 8.42.0
  • eslint-plugin-jsdoc version: 46.2.5

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions