Skip to main content

js/noDuplicateImportSource

disallow several import statements for a module

ESLint Equivalent: no-duplicate-imports

Examples

Invalid

import	foo	from	'./testdummy.ts';
import	{bar}	from	'./testdummy.ts';
import	type	{fooType}	from	'./testdummy.ts';

const	typedFoo:	fooType	=	{
	type:	'foo'
};

 file.ts:2 lint/js/noDuplicateImportSource  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━

  This module has already been imported.

    1import  foo  from  './testdummy.ts';
  > 2import  {bar}  from  './testdummy.ts';
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    3import  type  {fooType}  from  './testdummy.ts';

  Previously imported here

  > 1import  foo  from  './testdummy.ts';
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    2import  {bar}  from  './testdummy.ts';
    3import  type  {fooType}  from  './testdummy.ts';