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 github/web-systems-reviewers as a code owner Jul 14, 2020
'github/unescaped-html-literal': 'error',
'github/no-useless-passive': 'error',
'github/no-non-passive-high-frequency-events': 'error',
'github/prefer-observers-over-events': 'error'
Comment on lines 13 to 16

This comment has been minimized.

@keithamus

keithamus Jul 14, 2020
Author Member

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

This comment has been minimized.

@keithamus

keithamus Jul 14, 2020
Author Member

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 Jul 14, 2020
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>
@keithamus keithamus force-pushed the addEventListener-lints branch from 00eb1f3 to 1d3c50c Jul 14, 2020
Copy link
Member

@koddsson koddsson left a comment

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

Copy link
Member

@dgraham dgraham left a comment

⚡️

lib/configs/browser.js Outdated Show resolved Hide resolved
lib/configs/browser.js Outdated Show resolved Hide resolved
keithamus added 3 commits Jul 16, 2020
@keithamus keithamus merged commit c360c0e into master Jul 16, 2020
5 checks passed
5 checks passed
build (10.x)
Details
build (12.x)
Details
build (14.x)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@keithamus keithamus deleted the addEventListener-lints branch Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.