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

Resolve ESlint warnings #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gareth
Copy link

@gareth gareth commented Apr 16, 2024

The repo is configured with ESlint rules but they currently generate warnings:

$ npm exec eslint .

./Archipelago/ArchipelagoInterface.js
  1:72  warning  'ConnectionStatus' is assigned a value but never used  no-unused-vars
  2:9   warning  'User' is assigned a value but never used              no-unused-vars

./bot.js
  8:1  warning  'process' is not defined  no-undef
  9:1  warning  'process' is not defined  no-undef

./channelDeletedListeners/apInterfaceCloser.js
  1:9   warning  'Client' is assigned a value but never used        no-unused-vars
  1:17  warning  'GuildChannel' is assigned a value but never used  no-unused-vars

./scripts/registerSlashCommands.js
   9:55  warning  '__filename' is not defined  no-undef
  14:44  warning  '__filename' is not defined  no-undef

✖ 8 problems (0 errors, 8 warnings)

Although they're only warnings, I figure the config is there for a reason, so this PR resolves the issues.

Half of the issues were because ESlint was configured for browser environments, and ArchipelaBot isn't run in-browser, so this updates the config to correctly check in a node context.

gareth added 3 commits April 16, 2024 13:52
This resolves eslint errors caused by the tool
being configured for browser environments but not
finding e.g. the `process` module or the
`__filename` value.

Since this bot is not run in a browser context,
the eslint config should not assume that it does.
This keeps files confirming to POSIX standards
These were caused by unused imports - presumably
they were originally used but then the code was
moved into another file and the imports weren't
updated.
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