Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Since this type definition includes a header (a comment starting with // Type definitions for), assumed this was a DefinitelyTyped package. #758

Open
remarkablemark opened this issue Oct 18, 2023 · 6 comments

Comments

@remarkablemark
Copy link

When upgrading @definitelytyped/dtslint from 0.0.182 to 0.0.183, I am getting the dtslint error:

[email protected]
Error: Since this type definition includes a header (a comment starting with `// Type definitions for`), assumed this was a DefinitelyTyped package.
But it is not in a `DefinitelyTyped/types/xxx` directory: /home/runner/work/html-react-parser/html-react-parser
    at assertPathIsInDefinitelyTyped (/home/runner/work/html-react-parser/html-react-parser/node_modules/@definitelytyped/dtslint/dist/index.js:186:15)
    at runTests (/home/runner/work/html-react-parser/html-react-parser/node_modules/@definitelytyped/dtslint/dist/index.js:119:5)
    at main (/home/runner/work/html-react-parser/html-react-parser/node_modules/@definitelytyped/dtslint/dist/index.js:79:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

See remarkablemark/html-react-parser#1093

@jakebailey
Copy link
Member

Oh, eek, you're actually using this infra. We just did a huge refactor to make heavy use of pnpm and the header is now expected to be in package.json.

DefinitelyTyped/DefinitelyTyped#67085

@remarkablemark
Copy link
Author

@jakebailey Thanks for the quick response! Do you have an example of what I can do to fix the header?

@jakebailey
Copy link
Member

Probably just remove the headers entirely; but I haven't actually found the file with the header in your repo.

I'm more wondering what you're using dtslint for, and if you'd be better served by tsd or something.

@remarkablemark
Copy link
Author

I'm using dtslint to type check my custom declaration files since it's a JavaScript repo. Would tsd work better here?

@jakebailey
Copy link
Member

If you're just looking for ExpectType, probably, though I know that we have more lint rules that may be useful. But, those change based on DT's needs to I'm not totally sure how useful they are externally.

@remarkablemark
Copy link
Author

remarkablemark commented Oct 18, 2023

Thanks I'll take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants