forked from oslabs-beta/sapling
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: use Record, Array type annotation
- Record<string, unknown> is default recommended by @typescript-eslint/ban-types. - Using Array<T> when T is composite data type, and T[] when T is primitive is useful visual cue.
- Loading branch information
Showing
3 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
let children: Array<ChildInfo> = []; | ||
let ast: ASTNode | Record<string, Array<Token>>; | ||
private getImports(body: Array<ASTNode>): Record<string, ImportData> { | ||
.reduce((accum: Record<string, ImportData>, declaration) => { | ||
private parseImportDeclaration(declaration: ImportDeclaration): Record<string, ImportData> { | ||
const output: Record<string, ImportData> = {}; | ||
private parseVariableDeclaration(declaration: VariableDeclaration): Record<string, ImportData> { | ||
const output: Record<string, ImportData> = {}; | ||
imports: Record<string, ImportData>, | ||
astToken: Token, | ||
props: Record<string, boolean>, | ||
parent: Tree, | ||
children: Record<string, Tree> | ||
): Record<string, Tree> { | ||
astTokens: Array<Token>, | ||
imports: Record<string, ImportData>, | ||
let childNodes: Record<string, Tree> = {}; | ||
let props: Record<string, boolean> = {}; | ||
private getJSXProps(astTokens: Array<Token>, j: number): Record<string, boolean> { | ||
const props: Record<string, boolean> = {}; | ||
private checkForRedux(astTokens: Array<Token>, imports: Record<string, ImportData>): boolean { |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters