-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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): [require-types-exports] add rule #10554
base: main
Are you sure you want to change the base?
feat(eslint-plugin): [require-types-exports] add rule #10554
Conversation
View your CI Pipeline Execution ↗ for commit 8dc9607.
☁️ Nx Cloud last updated this comment at |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10554 +/- ##
==========================================
+ Coverage 86.86% 86.88% +0.02%
==========================================
Files 445 446 +1
Lines 15455 15640 +185
Branches 4507 4545 +38
==========================================
+ Hits 13425 13589 +164
- Misses 1675 1687 +12
- Partials 355 364 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -31,9 +31,9 @@ interface Config { | |||
}; | |||
} | |||
|
|||
type Options = [Config]; | |||
export type Options = [Config]; |
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.
Side note: Next rule has I lined the options and does not have Config as separate type. Maybe for consistency this type could be inlined too, if you are doing another PR just for these export changes :) Or if the separate Config type is preferred, maybe there could be some follow up
task for unifying these.
I don’t feel like this would matter if they would stay as internal types. But after they are exposed to “public”, it would look better if they had unified names. :)
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.
I know this is a draft, but just few suggestions to not to export empty types.
Edit: I should have left these comments on the another PR which is just about the type
exports 😅
type Options = []; | ||
type MessageIds = 'useTopLevelQualifier'; | ||
export type Options = []; | ||
export type MessageIds = 'useTopLevelQualifier'; | ||
|
||
export default createRule<Options, MessageIds>({ |
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.
export default createRule<Options, MessageIds>({ | |
export default createRule<[], MessageIds>({ |
@@ -10,8 +10,8 @@ import { | |||
NullThrowsReasons, | |||
} from '../util'; | |||
|
|||
type Options = []; | |||
type MessageIds = 'useTopLevelQualifier'; | |||
export type 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.
export type Options = []; |
(no longer needed)
type Options = []; | ||
type MessageIds = 'unaryMinus'; | ||
export type Options = []; | ||
export type MessageIds = 'unaryMinus'; | ||
|
||
export default util.createRule<Options, MessageIds>({ |
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.
export default util.createRule<Options, MessageIds>({ | |
export default util.createRule<[], MessageIds>({ |
@@ -3,8 +3,8 @@ import * as ts from 'typescript'; | |||
|
|||
import * as util from '../util'; | |||
|
|||
type Options = []; | |||
type MessageIds = 'unaryMinus'; | |||
export type 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.
export type Options = []; |
PR Checklist
Overview
Continuation of @StyleShit's #8443 as indicated in #8443 (comment).
Co-authored-by: @StyleShit