gajus / eslint-plugin-jsdoc

JSDoc specific linting rules for ESLint.
Other
1.1k stars 158 forks source link

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

Closed g1thuser closed 1 year ago

g1thuser commented 1 year ago

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

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 46.2.6 :tada:

The release is available on:

Your semantic-release bot :package::rocket: