Skip to content

Fix lint issue from 501993eb#14495

Merged
AUTOMATIC1111 merged 1 commit intoAUTOMATIC1111:devfrom
akx:fix-js-lint
Jan 1, 2024
Merged

Fix lint issue from 501993eb#14495
AUTOMATIC1111 merged 1 commit intoAUTOMATIC1111:devfrom
akx:fix-js-lint

Conversation

@akx
Copy link
Copy Markdown
Collaborator

@akx akx commented Jan 1, 2024

Description

ESlint doesn't like polluting global namespaces like that.

Also, unless you really do need to rebind this, foo(...args) is the more modern idiom for foo.apply(null, args).

Checklist:

@akx akx requested a review from AUTOMATIC1111 as a code owner January 1, 2024 17:21
@AUTOMATIC1111 AUTOMATIC1111 merged commit ac3cc1a into AUTOMATIC1111:dev Jan 1, 2024
@AUTOMATIC1111
Copy link
Copy Markdown
Owner

my bad; I keep making this mistake over and over with js; python...

@akx
Copy link
Copy Markdown
Collaborator Author

akx commented Jan 1, 2024

Heh, well, Lua was even worse – everything is global and you can also write to global names unless you declare them local.

Compounded by the fact that the global function to get a type from a variable is type, so you're one type = nil away from global disaster...

@w-e-w w-e-w mentioned this pull request Feb 17, 2024
@pawel665j pawel665j mentioned this pull request Apr 16, 2024
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.

2 participants