eslint-plugin-github icon indicating copy to clipboard operation
eslint-plugin-github copied to clipboard

Add TypeScript declaration file

Open robinloeffel opened this issue 11 months ago • 1 comments

In order to make the TypeScript language server see what actually is inside eslint-plugin-github, and to correctly suggest github.getFlatConfigs, I would like to request the addition of a declaration file.

Could not find a declaration file for module 'eslint-plugin-github'. '/Users/robin/Sites/eslint-config-sweet/node_modules/eslint-plugin-github/lib/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/eslint-plugin-github` if it exists or add a new declaration (.d.ts) file containing `declare module 'eslint-plugin-github';`ts(7016)

robinloeffel avatar Jan 31 '25 15:01 robinloeffel

Workaround:

declare module 'eslint-plugin-github' {
  import type {Eslint} from 'eslint';
  const plugin: Eslint.Plugin;
  export = plugin;
}

silverwind avatar Sep 14 '25 08:09 silverwind