Kind: Class
Source: atloria-monorepo/libs/parser-core/src/parsers/config-docs/json-config.parser.ts
JSON Config Parser implementation
Implements: IParser
Methods
| Method | Signature | Returns |
|---|---|---|
initialize | initialize(_config: ParserConfig) | Promise<void> |
canParse | canParse(filePath: string) | boolean |
parseFile | parseFile(filePath: string, content: string) | Promise<ParseResult> |
parseFiles | parseFiles(files: ParseFileInput[]) | Promise<ParseResult[]> |
destroy | destroy() | Promise<void> |
Properties
| Property | Type |
|---|---|
name | any |
version | any |
supportedPatterns | any |
Where it refuses work
JsonConfigParserstops the work with an early return whenfileName === 'package.json'.JsonConfigParserstops the work with an early return whenfileName.startsWith('tsconfig') || parsed['compilerOptions'].JsonConfigParserstops the work with an early return whenfileName.includes('eslint') || parsed['rules'] || parsed['extends'].JsonConfigParserstops the work with an early return whenfileName.includes('prettier').JsonConfigParserstops the work with an early return whenfileName.includes('jest') || parsed['testEnvironment'] || parsed['testMatch'].JsonConfigParserstops the work with an early return whenfileName.includes('babel') || parsed['presets'] || parsed['plugins'].
When something fails
JsonConfigParserhandles failure in 1 place: it turns it into a return value in all 1.
Was this page helpful?