Skip to content

Commit

Permalink
Clean up all JSDoc & ESLint warnings
Browse files Browse the repository at this point in the history
Disables max-len for now
Removes redundant JSDoc tags (empty, same name, wrong name, etc)
  • Loading branch information
webfiltered committed Nov 21, 2024
1 parent 986f8b5 commit 28ae15f
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 228 deletions.
10 changes: 8 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,14 @@ export default tseslint.config(
// "@typescript-eslint/no-unsafe-function-type": "off",

"@stylistic/max-len": [
"warn",
{ code: 100, comments: 130, ignoreStrings: true },
"off",
{
code: 100,
comments: 130,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreComments: true,
},
],

// "@stylistic/multiline-comment-style": ["warn", "starred-block"],
Expand Down
4 changes: 1 addition & 3 deletions src/CanvasPointer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import { dist2 } from "./measure"
* - {@link onDrag}
* - {@link onDragEnd}
* - {@link finally}
*
* @seealso
* @see
* - {@link LGraphCanvas.processMouseDown}
* - {@link LGraphCanvas.processMouseMove}
* - {@link LGraphCanvas.processMouseUp}
Expand Down Expand Up @@ -222,7 +221,6 @@ export class CanvasPointer {

/**
* Checks whether the pointer is currently past the max click drift threshold.
* @param e The latest pointer event
* @returns `true` if the latest pointer event is past the the click drift threshold
*/
#isDoubleClick(): boolean {
Expand Down
24 changes: 13 additions & 11 deletions src/ContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,33 @@ interface ContextMenuDivElement extends HTMLDivElement {
closing_timer?: number
}

// TODO: Replace this pattern with something more modern.
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
export interface ContextMenu {
constructor: new (...args: ConstructorParameters<typeof ContextMenu>) => ContextMenu
}

/**
* ContextMenu from LiteGUI
*
* @class ContextMenu
* @constructor
* @param {Array} values (allows object { title: "Nice text", callback: function ... })
* @param {Object} options [optional] Some options:\
* - title: title to show on top of the menu
* - callback: function to call when an option is clicked, it receives the item information
* - ignore_item_callbacks: ignores the callback inside the item, it just calls the options.callback
* - event: you can pass a MouseEvent, this way the ContextMenu appears in that position
*/
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
export class ContextMenu {
options?: IContextMenuOptions
parentMenu?: ContextMenu
root: ContextMenuDivElement
current_submenu?: ContextMenu
lock?: boolean

// TODO: Interface for values requires functionality change - currently accepts
// an array of strings, functions, objects, nulls, or undefined.
/**
* @todo Interface for values requires functionality change - currently accepts
* an array of strings, functions, objects, nulls, or undefined.
* @param values (allows object { title: "Nice text", callback: function ... })
* @param options [optional] Some options:\
* - title: title to show on top of the menu
* - callback: function to call when an option is clicked, it receives the item information
* - ignore_item_callbacks: ignores the callback inside the item, it just calls the options.callback
* - event: you can pass a MouseEvent, this way the ContextMenu appears in that position
*/
constructor(values: (IContextMenuValue | string)[], options: IContextMenuOptions) {
options ||= {}
this.options = options
Expand Down
Loading

0 comments on commit 28ae15f

Please sign in to comment.