Skip to content

report an error when a package imported in a @type is not present in package.json #896

@DetachHead

Description

@DetachHead

Motivation

i use import/no-extraneous-dependencies to ensure that i don't accidentally install and import dependencies without adding to package.json.

it would be nice to have that functionality in jsdoc @types as well

Current behavior

no error when eslint and/or @types/eslint is not present in dependencies or devDependencies in `package.json

/** @type {import('eslint').Linter.ParserOptions} */
const foo = {}

Desired behavior

error

Alternatives considered

raised an issue on eslint-plugin-import but it was suggested that i raise it here as it's apparently not able to check jsdocs - import-js/eslint-plugin-import#2508 (comment)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions