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

Revolintion: Apply most of the @thesis-co/eslint-config lint styling to the extension #3571

Merged
merged 5 commits into from
Aug 4, 2023

Commits on Jul 25, 2023

  1. Moves extension linting to the @thesis-co/eslint-config setup

    This is a more restrictive and opinionated set of rules based on the
    AirBnB style guide that reduces the degrees of freedom and bikeshedding
    across the repo, as well as generally representing Thesis best
    practices.
    
    A few notes:
    - This definitively moves us from a prior expressed preference for
      conditional React rendering of condition ? <Element /> : <></> to the
      more common null-punning approach of condition && <Element />. The
      style used in the past is disallowed by react/no-jsx-useless-fragment,
      which is part of the default airbnb style and therefore inherited
      through the Thesis config.
    - That rule also shifted a few places where we were returning <></> to
      return null instead, and updated return types accordingly. In one or
      two places where doing that would have a far-reaching impact, an
      eslint-ignore is used for now (with clarifying comment of course),
      which can be revisited in the future if we feel strongly about it.
    - This also pushes us away from the pattern of having () => {}-style
      functions with a single return statement inside, favoring instead
      making these return implicitly. A lot of the changes are around that.
    - There were also a few cases where undefineds were being left to dangle
      that got flagged and now get alternate empty states. Delightful!
    
    Last but not least, one whole rule is disabled so that we can get the
    core of this merged: react/no-unstable-nested-components has flagged a
    bunch of places where another pattern adopted in the current codebase
    (defining anonymous functions that return elements lazily) is being used
    in a way that's creating a lot of unnecessary diffs. Probably not
    impactful in the large, but regardless it would be good to fix this in
    the future, for now the rule is turned off with a FIXME comment.
    Shadowfiend committed Jul 25, 2023
    Configuration menu
    Copy the full SHA
    fd45e9f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    de55b3f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    92e7537 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2023

  1. Configuration menu
    Copy the full SHA
    0c4420e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4cf3ea4 View commit details
    Browse the repository at this point in the history