Thanks to visit codestin.com
Credit goes to github.com

Skip to content

docs: warn against progressive type enhancement in rules #7440

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

Conversation

JoshuaKGoldberg
Copy link
Member

PR Checklist

Overview

Adds a caution to the docs.

I wonder if this is overkill...?

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JoshuaKGoldberg!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@netlify
Copy link

netlify bot commented Aug 7, 2023

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit ab7eadd
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/64fefcdae41a0d0009abc689
😎 Deploy Preview https://deploy-preview-7440--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (🔴 down 3 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

bradzacher
bradzacher previously approved these changes Sep 7, 2023
@bradzacher bradzacher added documentation Documentation ("docs") that needs adding/updating 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labels Sep 7, 2023
:::caution
We recommend against changing rule logic on whether `services.program` exists.
In our experience, users are generally surprised when rules behave differently with or without type information.
Additionally, if they misconfigure their ESLint config, they may not realize why the rule started behaving differently.
Copy link
Member

Choose a reason for hiding this comment

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

This sounds vague. Maybe a specific case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm yeah good point. Agreed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

as possible solution we could recommend to create 2 separate rules one with type-info and one without

Copy link
Member Author

Choose a reason for hiding this comment

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

I like it! Added :)

Copy link
Member

Choose a reason for hiding this comment

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

Also gating it behind options is okay, I think.
That way you still have that hard point of a user explicitly opting in to the type-awareness and thus the rule can explicitly crash if it's not provided.

naming-convention does this (the only rule we have that does) for the type-based enforcement of names.

Copy link
Member Author

Choose a reason for hiding this comment

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

This actually is very relevant to vitest-dev/eslint-plugin-vitest#251. Nice.

@codecov
Copy link

codecov bot commented Sep 8, 2023

Codecov Report

Merging #7440 (1fad50d) into main (0a1de14) will decrease coverage by 0.19%.
Report is 98 commits behind head on main.
The diff coverage is n/a.

❗ Current head 1fad50d differs from pull request most recent head ab7eadd. Consider uploading reports for the commit ab7eadd to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7440      +/-   ##
==========================================
- Coverage   87.41%   87.23%   -0.19%     
==========================================
  Files         381      387       +6     
  Lines       13321    13404      +83     
  Branches     3938     3962      +24     
==========================================
+ Hits        11645    11693      +48     
- Misses       1298     1327      +29     
- Partials      378      384       +6     
Flag Coverage Δ
unittest 87.23% <ø> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 25 files with indirect coverage changes

@JoshuaKGoldberg JoshuaKGoldberg merged commit 458cd85 into typescript-eslint:main Oct 19, 2023
@JoshuaKGoldberg JoshuaKGoldberg deleted the docs-no-progressive-type-info branch October 19, 2023 17:35
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge documentation Documentation ("docs") that needs adding/updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Advise against "progressive enhancement" with rule type information
4 participants