Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release-2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benmosher committed Nov 3, 2016
2 parents 1186409 + 29bc56e commit 7205904
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
- [`no-extraneous-dependencies`]: check globs against CWD + absolute path ([#602] + [#630], thanks [@ljharb])

### Fixed
- [`prefer-default-export`] handles flow `export type` ([#484])
- [`prefer-default-export`] handles re-exported default exports ([#609])
- Fix crash when using [`newline-after-import`] with decorators ([#592])
- Properly report [`newline-after-import`] when next line is a decorator
Expand Down
3 changes: 3 additions & 0 deletions src/rules/prefer-default-export.js
Expand Up @@ -42,6 +42,9 @@ module.exports = {
// if there are specifiers, node.declaration should be null
if (!node.declaration) return

// don't count flow types exports
if (node.exportKind === 'type') return

if (node.declaration.declarations) {
node.declaration.declarations.forEach(function(declaration) {
captureDeclaration(declaration.id)
Expand Down
5 changes: 5 additions & 0 deletions tests/src/rules/prefer-default-export.js
Expand Up @@ -66,6 +66,11 @@ ruleTester.run('prefer-default-export', rule, {
import * as foo from './foo';`,
}),

test({
code: `export type UserId = number;`,
parser: 'babel-eslint',
}),

// ...SYNTAX_CASES,
],
invalid: [
Expand Down

0 comments on commit 7205904

Please sign in to comment.