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

Lints JavaScript code with ESLint locally and in CI #24

Merged
merged 9 commits into from
Sep 10, 2022

Conversation

willroberts
Copy link
Collaborator

@willroberts willroberts commented Sep 10, 2022

This sets and enforces a consistent style for new and existing code. This PR looks ridiculous (300k lines changed...) but I've broken up the commits to make it more reviewable.

I'm making this change now in order to increase our confidence in future changes. This also paves the way to running decaffeinate in order to get all game code using the same style, linters, etc.

Core changes:

  • Replaces xojs (an eslint wrapper) with just eslint. Configuration is in .eslintrc.json and .eslintignore (see 038090c).
  • Uses the Airbnb JavaScript Style Guide for ESLint rules, with some rules downgraded from error to warn to get things into a clean initial state.
  • Lints practically 100% of the repo's JavaScript code. Around 99.5% of these changes were automatically performed by eslint --fix. These changes are grouped in a single commit (63cc664) to make other changes more visible.
  • Adds a new linting job in GitHub Actions, which is passing in testing here.

100% of unit tests and an unchanged number of integration tests (87%) are still passing after this change.

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.

None yet

1 participant