File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
1616- [ ` order ` ] /[ ` newline-after-import ` ] : ignore TypeScript's "export import object" ([ #1830 ] , thanks [ @be5invis ] )
1717- [ ` dynamic-import-chunkname ` ] /TypeScript: supports ` @typescript-eslint/parser ` ([ #1833 ] , thanks [ @noelebrun ] )
1818- [ ` order ` ] /TypeScript: ignore ordering of object imports ([ #1831 ] , thanks [ @manuth ] )
19+ - [ ` namespace ` ] : do not report on shadowed import names ([ #518 ] , thanks [ @ljharb ] )
1920
2021### Changed
2122- [ ` no-extraneous-dependencies ` ] : add tests for importing types ([ #1824 ] , thanks [ @taye ] )
@@ -887,6 +888,7 @@ for info on changes for earlier releases.
887888[ #555 ] : https://github.com/benmosher/eslint-plugin-import/pull/555
888889[ #538 ] : https://github.com/benmosher/eslint-plugin-import/pull/538
889890[ #527 ] : https://github.com/benmosher/eslint-plugin-import/pull/527
891+ [ #518 ] : https://github.com/benmosher/eslint-plugin-import/pull/518
890892[ #509 ] : https://github.com/benmosher/eslint-plugin-import/pull/509
891893[ #508 ] : https://github.com/benmosher/eslint-plugin-import/pull/508
892894[ #503 ] : https://github.com/benmosher/eslint-plugin-import/pull/503
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ module.exports = {
106106 MemberExpression ( dereference ) {
107107 if ( dereference . object . type !== 'Identifier' ) return
108108 if ( ! namespaces . has ( dereference . object . name ) ) return
109+ if ( declaredScope ( context , dereference . object . name ) !== 'module' ) return
109110
110111 if ( dereference . parent . type === 'AssignmentExpression' && dereference . parent . left === dereference ) {
111112 context . report (
Original file line number Diff line number Diff line change 1+ export const example = 'example' ;
Original file line number Diff line number Diff line change @@ -164,6 +164,14 @@ const valid = [
164164 ] ) ,
165165
166166 ...SYNTAX_CASES ,
167+
168+ test ( {
169+ code : `
170+ import * as color from './color';
171+ export const getBackgroundFromColor = (color) => color.bg;
172+ export const getExampleColor = () => color.example
173+ ` ,
174+ } ) ,
167175]
168176
169177const invalid = [
You can’t perform that action at this time.
0 commit comments