Kind: Class
Source: atloria-monorepo/apps/frontend-parser/src/parsers/react.parser.ts
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 | string |
version | string |
supportedPatterns | string[] |
Where it refuses work
ReactParserstops the work with an early return when!name, in 3 places.ReactParserstops the work with an early return when!/^[A-Z]/.test(name), in 2 places.ReactParserstops the work with an early return when!this.canParse(filePath).ReactParserstops the work with an early return when!fileContent.trim().ReactParserstops the work with an early return when!t.isArrowFunctionExpression(init) && !t.isFunctionExpression(init).ReactParserstops the work with an early return when!hasJSXInPath(path).
When something fails
ReactParserhandles failure in 2 places: it turns it into a return value in all 2.
Was this page helpful?