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

Add event listener lints #110

Merged
merged 7 commits into from Jul 16, 2020
Merged

Add event listener lints #110

merged 7 commits into from Jul 16, 2020

Conversation

keithamus
Copy link
Member

@keithamus keithamus commented Jul 14, 2020

What?

This adds 3 new rules to our config/browser eslint config:

  • github/no-useless-passive
  • github/require-passive-events
  • github/prefer-observers

To read more about these rules, see the documentation md files in docs/

Why?

These represent our ideal best practices of how to author code for the GitHub frontend, and as such we'd like to enforce these rules with static analysis.

@keithamus keithamus requested a review from a team as a code owner July 14, 2020 15:50
Comment on lines 13 to 16
'github/unescaped-html-literal': 'error',
'github/no-useless-passive': 'error',
'github/no-non-passive-high-frequency-events': 'error',
'github/prefer-observers-over-events': 'error'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we consider this to be a breaking change? Do we want to release this as semver major?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To answer my own question, precedent exists for this to be semver minor, see #80 which was released as 3.3.0

keithamus and others added 4 commits July 14, 2020 16:56
Co-authored-by: Kristján Oddsson <koddsson@gmail.com>
Co-authored-by: Kristján Oddsson <koddsson@gmail.com>
Co-authored-by: Kristján Oddsson <koddsson@gmail.com>
Co-authored-by: Kristján Oddsson <koddsson@gmail.com>
Copy link
Contributor

@koddsson koddsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My review might not be worth as much since we worked on this with you but this looks great to me ✨

Copy link
Contributor

@dgraham dgraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡️

lib/configs/browser.js Outdated Show resolved Hide resolved
lib/configs/browser.js Outdated Show resolved Hide resolved
@keithamus keithamus merged commit c360c0e into master Jul 16, 2020
@keithamus keithamus deleted the addEventListener-lints branch July 16, 2020 10:55
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

3 participants