-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): add meta.docs.recommended setting for strict config options #8364
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
feat(eslint-plugin): add meta.docs.recommended setting for strict config options #8364
Conversation
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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8364 +/- ##
==========================================
- Coverage 88.02% 87.23% -0.79%
==========================================
Files 401 251 -150
Lines 13934 12334 -1600
Branches 4087 3881 -206
==========================================
- Hits 12265 10760 -1505
+ Misses 1370 1305 -65
+ Partials 299 269 -30
Flags with carried forward coverage won't be shown. Click here to find out more.
|
I don't know why linting is failing in Nx Cloud but not for me locally. From https://github.com/typescript-eslint/typescript-eslint/actions/runs/8159357644/job/22303718471?pr=8364:
cc @JamesHenry |
@JoshuaKGoldberg thats the same intermittent thing I mentioned on discord the other day. It's something to do with the combination of nx + |
That sounds plausible to me! |
export interface RuleRecommendationAcrossConfigs< | ||
Options extends readonly unknown[], | ||
> { | ||
recommended: true; | ||
strict: Partial<Options>; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Part of me doesn't like that we're leaking our internal documentation implementation details into our public types.
I wonder if there's a way for us to privatise these types to avoid leaking them to users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be nice. I don't know though 😞 and it's already there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #8695.
allowAny: false, | ||
allowBoolean: false, | ||
allowNullish: false, | ||
allowNumber: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is allowNumber: false
intended? If so, should this doc be updated?
This rule reports on values used in a template literal string that aren't strings, numbers, or BigInts, optionally allowing other data types that provide useful stringification results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you think there's a small typo in the docs like that, we'd welcome a PR :) thanks
PR Checklist
Overview
The gist of the changes are in the first two commits:
TOptions
throughmeta.docs
'sRuleMetaDataDocs
type to allow aRuleRecommendationAcrossConfigs
interface.generate:configs
script to handle those optionsNote that this is not a breaking change:
meta.docs.recommended
will still work, as the type is now a more permissive unionstrict*
configs explicitly indicate they can be modified as non-breaking changesSending as reference for triaging #7318.✅