Closed
Description
Motivation
With the new ESLint flat config we import plugins
import jsdoc from "eslint-plugin-jsdoc";
However that causes typescript in the VSCode to report an error due to missing type definitions.
Could not find a declaration file for module 'eslint-plugin-jsdoc'. 'myrepo/node_modules/eslint-plugin-jsdoc/dist/index.js' implicitly has an 'any' type.
Trynpm i --save-dev @types/eslint-plugin-jsdoc
if it exists or add a new declaration (.d.ts) file containingdeclare module 'eslint-plugin-jsdoc';
Current behavior
There are no types for eslint-plugin-jsdoc
Desired behavior
eslint-plugin-jsdoc
should bundle the typescript types.
I'm not sure this is correct, but here's an example of the d.ts
import type { ESLint } from "eslint";
interface JSDoc extends ESLint.Plugin {
configs: ESLint.Plugin["configs"] & {
recommended: ESLint.ConfigData;
["recommended-error"]: ESLint.ConfigData;
["recommended-typescript"]: ESLint.ConfigData;
["recommended-typescript-error"]: ESLint.ConfigData;
["recommended-typescript-flavor"]: ESLint.ConfigData;
["recommended-typescript-flavor-error"]: ESLint.ConfigData;
};
}
export default JSDoc;
Alternatives considered
A DefinitelyTyped package @types/eslint-plugin-jsdoc