# JsonConfigParser

**Kind:** Class

**Source:** [`atloria-monorepo/libs/parser-core/src/parsers/config-docs/json-config.parser.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/parser-core/src/parsers/config-docs/json-config.parser.ts#L58)

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

- `JsonConfigParser` stops the work with an early return when `fileName === 'package.json'`.
- `JsonConfigParser` stops the work with an early return when `fileName.startsWith('tsconfig') || parsed['compilerOptions']`.
- `JsonConfigParser` stops the work with an early return when `fileName.includes('eslint') || parsed['rules'] || parsed['extends']`.
- `JsonConfigParser` stops the work with an early return when `fileName.includes('prettier')`.
- `JsonConfigParser` stops the work with an early return when `fileName.includes('jest') || parsed['testEnvironment'] || parsed['testMatch']`.
- `JsonConfigParser` stops the work with an early return when `fileName.includes('babel') || parsed['presets'] || parsed['plugins']`.

## When something fails

- `JsonConfigParser` handles failure in 1 place: it turns it into a return value in all 1.
