Skip to content

fix: false positives for typescript type + value export#1319

Merged
ljharb merged 1 commit intoimport-js:masterfrom
bradzacher:export-ts-type-value
Apr 12, 2019
Merged

fix: false positives for typescript type + value export#1319
ljharb merged 1 commit intoimport-js:masterfrom
bradzacher:export-ts-type-value

Conversation

@bradzacher
Copy link
Copy Markdown
Contributor

Fixes #1318

@ljharb
Copy link
Copy Markdown
Member

ljharb commented Apr 12, 2019

This seems like it might overlap with #923?

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.1%) to 97.764% when pulling abb354a on bradzacher:export-ts-type-value into 70a59fe on benmosher:master.

@bradzacher
Copy link
Copy Markdown
Contributor Author

@ljharb to prevent double commenting - #1318 (comment)

Comment thread src/rules/export.js Outdated
if ([
'TSTypeAliasDeclaration',
'TSInterfaceDeclaration',
].includes(node.declaration.type)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

includes isn't available on node 4; we'll need to add the array-includes package here.

Comment thread tests/src/rules/export.js Outdated
export const Foo = 1;
export type Foo = number;
`,
...parserConfig,
Copy link
Copy Markdown
Member

@ljharb ljharb Apr 12, 2019

Choose a reason for hiding this comment

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

also, object spread isn't on node < 8.

Copy link
Copy Markdown
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Rebased and fixed.

@ljharb ljharb merged commit 2098797 into import-js:master Apr 12, 2019
ljharb added a commit that referenced this pull request Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

import/export: false positives for typescript type + value export

3 participants