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

enforce Async suffix for async functions #623

Merged
merged 3 commits into from
Sep 16, 2021
Merged

Conversation

dsokal
Copy link
Contributor

@dsokal dsokal commented Sep 16, 2021

Checklist

  • I've added an entry to CHANGELOG.md if necessary.
  • I've tagged the changelog entry with [EAS BUILD API] if it's a part of a breaking change to EAS Build API (only possible when updating @expo/eas-build-job package).

Why

We use Async suffix for async functions. Unfortunately, we haven't had any eslint rule that would enforce that convention.

How

  • I installed https://github.com/IPWright83/eslint-plugin-async-protect and enabled the async-protect/async-suffix rule for all files except tests and mocks (mostly because jest.fn() does not return an async function).
  • I refactored all CLI command classes so they extend the EasCommand class. This let me avoid adding the eslint-disable-next-line statement in every command class. (cc @kgc00)

Test Plan

CI

@github-actions
Copy link

github-actions bot commented Sep 16, 2021

Size Change: -1.62 kB (0%)

Total Size: 27.1 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 27.1 MB -1.62 kB (0%)

compressed-size-action

@dsokal dsokal marked this pull request as ready for review September 16, 2021 09:39
@dsokal dsokal requested review from wkozyra95 and kgc00 September 16, 2021 09:39
@dsokal dsokal merged commit 441f3ea into main Sep 16, 2021
@dsokal dsokal deleted the @dsokal/enforce-async-suffix branch September 16, 2021 09:46
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