import NormalizedPath from '../types/NormalizedPath' ; import validateExportRules from './validateExportRules' ; import getImportsFromFile from '../utils/getImportsFromFile' ; import validateDependencyRules from './validateDependencyRules' ; import validateImportRules from './validateImportRules' ; import { SourceFileProvider } from '../core/SourceFileProvider' ; export default async function validateFile ( filePath , fileProvider ) { const imports = await getImportsFromFile ( filePath , fileProvider ) ; for ( let importRecord of imports ) { validateExportRules ( filePath , importRecord ) ; if ( importRecord . isExternal ) { validateDependencyRules ( filePath , importRecord ) ; } else { validateImportRules ( filePath , importRecord ) ; } } }