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

Add eslint #195

Merged
merged 2 commits into from
Jul 14, 2024
Merged

Add eslint #195

merged 2 commits into from
Jul 14, 2024

Conversation

xPaw
Copy link
Contributor

@xPaw xPaw commented Jun 24, 2024

Only basic config for now, more rules can be enabled in the future. I also added a CI job to run this.

// @license MIT
// @version 6.9.3
// @description Enhances the Steam Inventory and Steam Market.
// @match https://steamcommunity.com/id/*/inventory*
Copy link
Contributor Author

@xPaw xPaw Jun 24, 2024

Choose a reason for hiding this comment

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

I changed @include to @match as the userscripts lint suggested that for manifest v3.


/* disable some eslint rules until the code is cleaned up */
/* global unsafeWindow, luxon, jQuery, async, localforage */
/* eslint no-undef: off, no-unused-vars: off */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These rules are disabled since the code needs some cleanup to fix them.

@@ -2209,8 +2212,8 @@
var arr = [];

for (var child in getActiveInventory().m_rgChildInventories) {
for (var key in getActiveInventory().m_rgChildInventories[child].m_rgAssets) {
var value = getActiveInventory().m_rgChildInventories[child].m_rgAssets[key];
for (const key in getActiveInventory().m_rgChildInventories[child].m_rgAssets) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Vars changed to const/let to reduce scope because they were redefining these.

@Nuklon
Copy link
Owner

Nuklon commented Jul 14, 2024

Thanks for the PRs @xPaw. This now has a conflict, I think because of the match changes.

@xPaw
Copy link
Contributor Author

xPaw commented Jul 14, 2024

@Nuklon i've fixed that and opened a few more prs 😄

@Nuklon Nuklon merged commit c6d0256 into Nuklon:master Jul 14, 2024
@xPaw xPaw deleted the eslint branch July 14, 2024 16:56
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