forked from tahowallet/extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
4d97a2e
commit fd45e9f
Showing
164 changed files
with
3,932 additions
and
2,995 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.