-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Issues with module's types #247
Comments
I don't use Typescript myself (Although I really want to, I haven't found the time to look into it). ./node_modules/typescript/bin/tsc Throws the following:
I'm assuming this isn't the issue you're referring to? Are you able to provide the error that you're seeing please? The type definitions are all automatically generated from the doc blocks in the code. I'm happy for a PR to fix any faulty ones. |
Sorry, I forgot to attach the actual error.
I also forgot to mention that the test file is just called test.ts which then gets transpiled to test.js. Output after executing tsc: "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const rpg_dice_roller_1 = require("@dice-roller/rpg-dice-roller");
const roller = new rpg_dice_roller_1.DiceRoll("6d6");
console.log(roller.toString()); |
I've submitted a PR with partial fixes for this. There may be a better way to handle this, but the problem is the seven files above reference types in the JS docs, but when the TypeScript definitions are generated they're not getting resolved/imported. Two files still have issues:
For DieActionValueError For Modifier For both of these ESLint errors on a detected dependency cycle. |
Well drat. I just started a new project that uses this and just ran into these issues again ... :| |
Describe the bug
Some of the type definitions seems to be faulty or incomplete.
To Reproduce
Steps to reproduce the behaviour:
npm i typescript --save-dev && npx tsc --init
)npm install @dice-roller/rpg-dice-roller
)skipLibCheck
to false in tsconfig.jsonExpected behaviour
No type errors show up.
Code snippet
Environment:
The text was updated successfully, but these errors were encountered: