-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[bugfix] Re: #1332 - skip warning on a type declaration or alias. #1377
[bugfix] Re: #1332 - skip warning on a type declaration or alias. #1377
Conversation
2 similar comments
a686d0e
to
382b26c
Compare
I came across another the failing case with a single named export i.e. this errors: type foo = string;
export { foo } could we merge those fixes in a separate PR? cc. @ljharb |
@sharmilajesupaul if this PR, once rebased, passes tests, then it's up to you if you want to defer those fixes to another PR - but it's also great if you can include them in this PR too :-) |
53f79e6
to
3ea8b4a
Compare
@sharmilajesupaul i've fixed the test issues around eslint and typescript parser versions; but now there's some seemingly legit failures. Can you look into them? |
3ea8b4a
to
adf4aaa
Compare
9b48d2e
to
22c27b9
Compare
078d712
to
79da3d1
Compare
79da3d1
to
f4e3f1b
Compare
if (node.exportKind === 'type') return | ||
|
||
if ( | ||
node.declaration.type === 'TSTypeAliasDeclaration' || | ||
node.declaration.type === 'TypeAlias' |
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.
@sharmilajesupaul @brieb should this also ignore interfaces? I believe the Babel/TypeScript AST type is InterfaceDeclaration
and the typescript eslint parser type is TSInterfaceDeclaration
.
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.
Similar to import-js#1377, we don't want this rule to apply to exported interfaces.
Fixes #1332
Skips warning on a single type declaration or type alias.
Remove the check forI believe this is used in eslint v2 & 3node.exportKind
as it isundefined
in all test cases.This should work with
@typescript-eslint/parser
too, but I'm not testing that here because this repo is still usingtypescript-eslint-parser
.cc. @ljharb