-
-
Notifications
You must be signed in to change notification settings - Fork 412
prefer-math-min-max
: Reduce false positives in TypeScript
#2527
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
Conversation
prefer-math-min-max
: priority support for typescriptprefer-math-min-max
: minimize false positives in TypeScript
/cc @fisker |
rules/prefer-math-min-max.js
Outdated
/** | ||
* Capture the following statement | ||
* ```js | ||
* function foo(a: number) {} | ||
* ``` | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** | |
* Capture the following statement | |
* ```js | |
* function foo(a: number) {} | |
* ``` | |
*/ | |
/** | |
Capture the following statement: | |
```js | |
function foo(a: number) {} | |
``` | |
*/ |
Applies tool the comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sindresorhus Updated.
BTW. should we write an eslint plugin to validate jsdoc since it is not the default jsdoc style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@axetroy I think we can just add this rule to this package for now (PR welcome): https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-asterisk-prefix.md#readme I plan to add it to XO eventually.
prefer-math-min-max
: minimize false positives in TypeScriptprefer-math-min-max
: Reduce false positives in TypeScript
Close #2509
This PR prioritizes reducing false positives by checking types.
Note that you need to specify the type explicitly