eslint-plugin-sonarjs
Version:
32 lines (31 loc) • 1.47 kB
TypeScript
export declare const DEFAULT_TEST_FILE_EXTENSIONS: string[];
/**
* Canonical filename markers denoting a test-related file. Every pattern recognising these markers
* derives its alternation from this list, so the set cannot drift between helpers.
*/
export declare const TEST_RELATED_MARKERS: readonly ["test", "spec", "cy", "e2e", "mock"];
/**
* Checks whether a file path matches a test file pattern.
*
* @param filePath the file path to test.
* @param extensions the allowed test file extensions.
* @returns true when the path looks like a test file.
*/
export declare function isTestFile(filePath: string, extensions?: string[]): boolean;
/**
* Checks whether a file path looks test-related.
*
* @param filePath the file path to test.
* @param extensions the allowed test file extensions.
* @returns true when the path looks test-related.
*/
export declare function isTestRelatedFile(filePath: string, extensions?: string[]): boolean;
/**
* Checks whether a file path has the shape of an Angular per-environment config file named after a
* test-related marker, e.g. `src/environments/environment.test.ts`. This is a pure filename check:
* such a path is only a *candidate*, since nothing here tells whether the project is Angular.
*
* @param filePath the file path to test.
* @returns true when the path looks like an Angular environment-config file.
*/
export declare function isAngularEnvironmentConfigFileCandidate(filePath: string): boolean;