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

Fix types in JSDoc #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

szepeviktor
Copy link
Contributor

@szepeviktor szepeviktor commented Dec 1, 2024

tsconfig.json

{
  "compilerOptions": {
    "target": "es2017",
    "module": "es6",
    "allowJs": true,
    "checkJs": true,
    "noEmit": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true
  }
}
yarn add typescript
yarn run tsc

@@ -4,7 +4,6 @@ export default class Cookie
* Make a new Cookie instance.
*
* @param {string} namespace
* @return {void}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No return tag for constructor.

Comment on lines -46 to +49
* @param {mixed} value
* @return {mixed}
* @param {*} value
* @return {*}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHP: mixed
JS: *

Comment on lines -81 to +83
this.set(key, null, 'Thu, 01 Jan 1970 00:00:01 GMT');
this.set(key, '', 'Thu, 01 Jan 1970 00:00:01 GMT');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null is not compatible with string

Comment on lines +36 to +37
/** @type {string[]} */
const initialValue = [];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sets the type for the empty array.

@szepeviktor
Copy link
Contributor Author

@adamlaki This is not a business PR but a scientific PR 👺

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

Successfully merging this pull request may close these issues.

1 participant