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

Remove flow type annotations, set up ESLint #623

Merged
merged 8 commits into from
Jun 10, 2024
Merged

Remove flow type annotations, set up ESLint #623

merged 8 commits into from
Jun 10, 2024

Commits on Jun 7, 2024

  1. Install eslint

    I did this by running:
    
    ```
    npm init @eslint/config@latest
    ```
    lencioni committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    97d8e2d View commit details
    Browse the repository at this point in the history
  2. Remove flow type annotations

    We know that we do not want to use flow anymore. We may want to adopt
    TypeScript, but it is unclear if we will in the near term.
    
    #593
    
    I want to re-introduce ESLint, and instead of setting up ESLint to be
    able to parse flow syntax, I decided that we should just remove it.
    
    #608
    
    I removed these annotations by running the following command:
    
    ```
    npx flow-remove-types lib/ -d lib/
    ```
    
    Then I formatted the files by running prettier on everything:
    
    ```
    node_modules/.bin/prettier -w lib/
    ```
    
    I think if we wanted to introduce TypeScript that it might be easier to
    do it from scratch anyway instead of attempting to convert the flow
    types over to a different type system.
    lencioni committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    0e5eeb5 View commit details
    Browse the repository at this point in the history
  3. Remove Flow dev dependencies

    TypeScript pretty much won, and we've removed Flow annotations from this
    repo.
    lencioni committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    7d5c1c9 View commit details
    Browse the repository at this point in the history
  4. Add npm run jest:watch command

    For convenience.
    lencioni committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    98c8ec3 View commit details
    Browse the repository at this point in the history
  5. Configure ESLint better

    This is a node project, not a browser project, so we need to use the
    node globals. And we also need to tell ESLint about our tests, and how
    to ignore the stuff that used to be in the .eslintignore file.
    
    This resolves most of the errors.
    lencioni committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    3806e32 View commit details
    Browse the repository at this point in the history
  6. Fix ESLint errors

    Now that we have ESLint set up, we need to fix the things it complained
    about. This handles all of that in one commit.
    lencioni committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    73b24eb View commit details
    Browse the repository at this point in the history
  7. Add Lint GitHub workflow

    This will help us avoid committing errors.
    lencioni committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    fd0c5e7 View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2024

  1. Add eslint to npm test

    This will make it easier for folks to catch errors as they work.
    lencioni committed Jun 9, 2024
    Configuration menu
    Copy the full SHA
    bc3bd79 View commit details
    Browse the repository at this point in the history