# Class: RedundantImportsDetector

@boll/rules-typescriptGlobalsRedundantImportsDetector

# Class: RedundantImportsDetector

RedundantImportsDetector will detect imports that are importing from a location that another import in the same file is already importing from.

Imports from the same location should be done in the same import statement.

# Hierarchy

  • RedundantImportsDetector

# Implements

  • PackageRule

# Index

# Accessors

# Methods

# Accessors

# name

get name(): string

Defined in redundant-imports-detector.ts:24

Returns: string

# Methods

# check

check(fileContext: FileContext): Promise‹Result[]›

Defined in redundant-imports-detector.ts:28

Parameters:

Name Type
fileContext FileContext

Returns: Promise‹Result[]›


# checkImportPaths

checkImportPaths(fileName: BollFile, importPaths: ImportPathAndLineNumber[]): Result[]

Defined in redundant-imports-detector.ts:32

Parameters:

Name Type
fileName BollFile
importPaths ImportPathAndLineNumber[]

Returns: Result[]


# getImportPaths

getImportPaths(sourceFile: SourceFile): ImportPathAndLineNumber[]

Defined in redundant-imports-detector.ts:50

Parameters:

Name Type
sourceFile SourceFile

Returns: ImportPathAndLineNumber[]