Skip to content
Permalink
Browse files

Merge ea6019c into e62011f

  • Loading branch information
AamuLumi committed Oct 16, 2019
2 parents e62011f + ea6019c commit 9c3f61ac5b1e2329d58726e1f88ed5c620f02ef0
Showing with 8 additions and 3 deletions.
  1. +5 −1 CHANGELOG.md
  2. +1 −1 src/core/importType.js
  3. +2 −1 tests/src/core/importType.js
@@ -14,7 +14,8 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
### Fixed
- `default`: make error message less confusing ([#1470], thanks [@golopot])
- Support export of a merged typescript namespace declaration ([#1495], thanks [@benmunro])
- [`import/order`]: fix autofix to not move imports across fn calls ([#1253], thanks [@tihonove])
- [`order`]: fix autofix to not move imports across fn calls ([#1253], thanks [@tihonove])
- [`order`]: fix `@someModule` considered as `unknown` instead of `internal` ([#1493], thanks [@aamulumi])

## [2.18.2] - 2019-07-19
- Skip warning on type interfaces ([#1425], thanks [@lencioni])
@@ -610,6 +611,7 @@ for info on changes for earlier releases.
[`memo-parser`]: ./memo-parser/README.md

[#1495]: https://github.com/benmosher/eslint-plugin-import/pull/1495
[#1493]: https://github.com/benmosher/eslint-plugin-import/pull/1493
[#1472]: https://github.com/benmosher/eslint-plugin-import/pull/1472
[#1470]: https://github.com/benmosher/eslint-plugin-import/pull/1470
[#1436]: https://github.com/benmosher/eslint-plugin-import/pull/1436
@@ -996,3 +998,5 @@ for info on changes for earlier releases.
[@TrevorBurnham]: https://github.com/TrevorBurnham
[@benmunro]: https://github.com/benmunro
[@tihonove]: https://github.com/tihonove
[@golopot]: https://github.com/golopot
[@aamulumi]: https://github.com/aamulumi
@@ -43,7 +43,7 @@ export function isExternalModuleMain(name, settings, path) {
return externalModuleMainRegExp.test(name) && isExternalPath(path, name, settings)
}

const scopedRegExp = /^@[^/]+\/[^/]+/
const scopedRegExp = /^@[^/]+\/?[^/]+/
function isScoped(name) {
return scopedRegExp.test(name)
}
@@ -30,6 +30,7 @@ describe('importType(name)', function () {
})

it("should return 'external' for scopes packages", function() {
expect(importType('@cycle/', context)).to.equal('external')
expect(importType('@cycle/core', context)).to.equal('external')
expect(importType('@cycle/dom', context)).to.equal('external')
expect(importType('@some-thing/something', context)).to.equal('external')
@@ -55,6 +56,7 @@ describe('importType(name)', function () {
it("should return 'internal' for internal modules that are referenced by aliases", function () {
const pathContext = testContext({ 'import/resolver': { node: { paths: [pathToTestFiles] } } })
expect(importType('@my-alias/fn', pathContext)).to.equal('internal')
expect(importType('@importType', pathContext)).to.equal('internal')
})

it("should return 'internal' for aliased internal modules that look like core modules (node resolver)", function () {
@@ -96,7 +98,6 @@ describe('importType(name)', function () {
})

it("should return 'unknown' for any unhandled cases", function() {
expect(importType('@malformed', context)).to.equal('unknown')
expect(importType(' /malformed', context)).to.equal('unknown')
expect(importType(' foo', context)).to.equal('unknown')
})

0 comments on commit 9c3f61a

Please sign in to comment.
You can’t perform that action at this time.