Function: filterPathsByExtension()
function filterPathsByExtension(paths, extensions): string[];
Defined in: paths.ts:17
Filter CLI path arguments to those a detector should handle, given the file extensions it owns.
- Explicit file paths whose extension isn't owned are dropped, so a detector doesn't lint (and warn about) another language's files when the CLI forwards the same path list to every detector.
- Directories, extensionless args, and globs — including brace globs like
**/*.{js,ts}whose extension is ambiguous — are kept, letting the underlying tool expand and match them itself.
Extensions are compared case-insensitively and must include the leading dot
(e.g. ".ts").
Parameters
| Parameter | Type |
|---|---|
paths |
string[] |
extensions |
ReadonlySet<string> |
Returns
string[]