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

chore: custom lint rules #18206

Merged
merged 6 commits into from
Oct 26, 2023
Merged

chore: custom lint rules #18206

merged 6 commits into from
Oct 26, 2023

Conversation

daibhin
Copy link
Contributor

@daibhin daibhin commented Oct 26, 2023

Problem

The warning lint rules for react/forbid-elements are not applied because of a duplicate key in the object. This means that the warnings never appear in files

Changes

  • Add support for custom linting rules
  • Duplicate the react/forbid-elements rule and rename it posthog/warn-elements

Based on the great work from @pauldambra in PostHog/posthog-js#843

How did you test this code?

Before After
Screenshot 2023-10-26 at 11 24 07 Screenshot 2023-10-26 at 11 21 55

@daibhin daibhin requested a review from pauldambra October 26, 2023 10:26
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

6 snapshot changes in total. 0 added, 6 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@@ -0,0 +1,3 @@
const { rules } = require('eslint-plugin-react')

module.exports = rules['forbid-elements']
Copy link
Member

Choose a reason for hiding this comment

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

noice! 💯

@@ -1,4 +1,4 @@
lockfileVersion: '6.1'
lockfileVersion: '6.0'
Copy link
Member

Choose a reason for hiding this comment

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

pnpm is opaque to me... do we care about this downgrade?

Copy link
Collaborator

Choose a reason for hiding this comment

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

don't worry, a random PR from me will upgrade it soon anyway ☠️ , and the cycle will continue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't find the exact link but I came across this in another thread recently and the tldr was that it just flapped based on a local pnpm version. Not majorly important

@daibhin daibhin merged commit 40bbf00 into master Oct 26, 2023
73 checks passed
@daibhin daibhin deleted the dn-chore/custom-lint-rules branch October 26, 2023 11:11
Gilbert09 pushed a commit that referenced this pull request Oct 30, 2023
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.

4 participants