• Home
  • Raw
  • Download

Lines Matching refs:ts

16 import ts from 'typescript';
101 localStorageNode: ts.Identifier | ts.ObjectLiteralExpression;
167 fileQuery: string, sourceFile: ts.SourceFile = null): LogInfo[] {
185 fileQuery: string, sourceFile: ts.SourceFile | null): LogInfo[] | null {
188 …sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.ETS…
200 if (ts.isEnumDeclaration(item) && item.name) {
203 if (ts.isStructDeclaration(item)) {
204 if (item.name && ts.isIdentifier(item.name)) {
216 if (ts.isMissingDeclaration(item)) {
217 const decorators: ts.NodeArray<ts.Decorator> = item.decorators;
276 export function isObservedClass(node: ts.Node): boolean {
277 if (ts.isClassDeclaration(node) && hasDecorator(node, COMPONENT_OBSERVED_DECORATOR)) {
283 export function isCustomDialogClass(node: ts.Node): boolean {
284 if (ts.isStructDeclaration(node) && hasDecorator(node, COMPONENT_DECORATOR_CUSTOM_DIALOG)) {
295 function checkDecorators(decorators: ts.NodeArray<ts.Decorator>, result: DecoratorResult,
296 …component: ts.Identifier, log: LogInfo[], sourceFile: ts.SourceFile, node: ts.StructDeclaration): …
301 …if (element.expression && element.expression.expression && ts.isIdentifier(element.expression.expr…
352 function checkConcurrentDecorator(node: ts.FunctionDeclaration | ts.MethodDeclaration, log: LogInfo…
353 sourceFile: ts.SourceFile): void {
358 if (ts.isMethodDeclaration(node)) {
364 …const checkAsyncModifier = (modifier: ts.Modifier) => modifier.kind === ts.SyntaxKind.AsyncKeyword;
372 function collectLocalStorageName(node: ts.Decorator): void {
373 if (node && node.expression && ts.isCallExpression(node.expression)) {
375 node.expression.arguments.forEach((item: ts.Node, index: number) => {
376 if (ts.isIdentifier(item) && index === 0) {
379 } else if (ts.isObjectLiteralExpression(item) && index === 0) {
392 log: LogInfo[], sourceFile: ts.SourceFile | null, fileQuery: string): void {
394 …sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true, ts.ScriptKind.ET…
403 function visitAllNode(node: ts.Node, sourceFileNode: ts.SourceFile, allComponentNames: Set<string>,
405 if (ts.isStructDeclaration(node) && node.name && ts.isIdentifier(node.name)) {
409 if (ts.isMethodDeclaration(node) || ts.isFunctionDeclaration(node)) {
413 if (ts.isFunctionDeclaration(node)) {
418 } else if (ts.isFunctionDeclaration(node) && isExtendFunction(node, extendResult)) {
427 if (ts.isBlock(node.body) && node.body.statements) {
428 if (ts.isFunctionDeclaration(node)) {
442 if (ts.isIdentifier(node) && (ts.isDecorator(node.parent) ||
443 (ts.isCallExpression(node.parent) && ts.isDecorator(node.parent.parent)))) {
448 …node.getChildren().forEach((item: ts.Node) => visitAllNode(item, sourceFileNode, allComponentNames,
453 function validateStructDecorator(sourceFileNode: ts.SourceFile, node: ts.Identifier, log: LogInfo[],
461 function validateMethodDecorator(sourceFileNode: ts.SourceFile, node: ts.Identifier, log: LogInfo[],
464 if (ts.isMethodDeclaration(node.parent.parent) ||
465 (ts.isDecorator(node.parent.parent) && ts.isMethodDeclaration(node.parent.parent.parent))) {
479 node: ts.EtsComponentExpression,
481 sourceFileNode: ts.SourceFile,
484 if (ts.isIdentifier(node.expression)) {
496 function checkNoChildComponent(node: ts.EtsComponentExpression, sourceFileNode: ts.SourceFile, log:…
499 const componentName: string = (node.expression as ts.Identifier).escapedText.toString();
509 function hasChild(node: ts.EtsComponentExpression, isCheckType: ParamType): boolean {
510 const nodeName: ts.Identifier = node.expression as ts.Identifier;
518 function judgeComponentType(nodeName: ts.Identifier, etsComponentExpression: ts.EtsComponentExpress…
522 ts.isObjectLiteralExpression(etsComponentExpression.arguments[0]) &&
542 function getNextNode(node: ts.EtsComponentExpression): ts.Block {
543 if (node.body && ts.isBlock(node.body)) {
544 const statementsArray: ts.Block = node.body;
549 function checkOneChildComponent(node: ts.EtsComponentExpression, allComponentNames: Set<string>,
550 sourceFileNode: ts.SourceFile, log: LogInfo[]): void {
553 const componentName: string = (node.expression as ts.Identifier).escapedText.toString();
563 function hasNonSingleChild(node: ts.EtsComponentExpression, allComponentNames: Set<string>,
565 const nodeName: ts.Identifier = node.expression as ts.Identifier;
566 const BlockNode: ts.Block = getNextNode(node);
589 function getBlockChildrenCount(blockNode: ts.Block, allComponentNames: Set<string>): number {
593 const item: ts.Node = blockNode.statements[i];
594 if (ts.isExpressionStatement(item) && ts.isCallExpression(item.expression) &&
598 if (ts.isIfStatement(item)) {
601 if (ts.isExpressionStatement(item) && ts.isEtsComponentExpression(item.expression)) {
604 if (ts.isExpressionStatement(item) && ts.isCallExpression(item.expression)) {
607 if (ts.isEtsComponentExpression(newNode) || ts.isCallExpression(newNode) &&
621 function isComponent(node: ts.EtsComponentExpression | ts.CallExpression, allComponentNames: Set<st…
622 if (ts.isIdentifier(node.expression) &&
629 function isForEachComponent(node: ts.EtsComponentExpression | ts.CallExpression): boolean {
630 if (ts.isIdentifier(node.expression)) {
637 function getIfChildrenCount(ifNode: ts.IfStatement, allComponentNames: Set<string>): number {
644 function getStatementCount(node: ts.Node, allComponentNames: Set<string>): number {
648 } else if (ts.isBlock(node)) {
650 } else if (ts.isIfStatement(node)) {
652 } else if (ts.isExpressionStatement(node) && ts.isEtsComponentExpression(node.expression) &&
655 } else if (ts.isExpressionStatement(node) && ts.isEtsComponentExpression(node.expression) &&
662 function checkSpecificChildComponent(node: ts.EtsComponentExpression, allComponentNames: Set<string…
663 sourceFileNode: ts.SourceFile, log: LogInfo[]): void {
665 const componentName: string = (node.expression as ts.Identifier).escapedText.toString();
675 function hasNonspecificChild(node: ts.EtsComponentExpression,
677 const nodeName: ts.Identifier = node.expression as ts.Identifier;
679 const blockNode: ts.Block = getNextNode(node);
691 function isNonspecificChildBlock(blockNode: ts.Block, specificChildSet: Set<string>,
696 const item: ts.Node = blockNode.statements[i];
697 … if (ts.isIfStatement(item) && isNonspecificChildIf(item, specificChildSet, allComponentNames)) {
700 if (ts.isExpressionStatement(item) && ts.isCallExpression(item.expression) &&
705 if (ts.isBlock(item) && isNonspecificChildBlock(item, specificChildSet, allComponentNames)) {
708 if (ts.isExpressionStatement(item)) {
711 if (ts.isEtsComponentExpression(newNode) && ts.isIdentifier(newNode.expression) &&
718 if (i + 1 < length && ts.isBlock(blockNode.statements[i + 1])) {
730 function isNonspecificChildIf(node: ts.IfStatement, specificChildSet: Set<string>,
736 function isNonspecificChildForEach(node: ts.EtsComponentExpression, specificChildSet: Set<string>,
738 if (ts.isCallExpression(node) && node.arguments &&
739 node.arguments.length > 1 && ts.isArrowFunction(node.arguments[1])) {
740 const arrowFunction: ts.ArrowFunction = node.arguments[1] as ts.ArrowFunction;
741 const body: ts.Block | ts.EtsComponentExpression | ts.IfStatement =
742 arrowFunction.body as ts.Block | ts.EtsComponentExpression | ts.IfStatement;
746 if (ts.isBlock(body) && isNonspecificChildBlock(body, specificChildSet, allComponentNames)) {
749 if (ts.isIfStatement(body) && isNonspecificChildIf(body, specificChildSet, allComponentNames)) {
752 if (ts.isCallExpression(body) && isForEachComponent(body) &&
756 if (ts.isEtsComponentExpression(body) && !isForEachComponent(body) &&
765 function isNonspecificChildNonForEach(node: ts.EtsComponentExpression,
767 if (ts.isIdentifier(node.expression) &&
774 function isNonspecificChildIfStatement(node: ts.Node, specificChildSet: Set<string>,
779 if (ts.isBlock(node) && isNonspecificChildBlock(node, specificChildSet, allComponentNames)) {
782 if (ts.isIfStatement(node) && isNonspecificChildIf(node, specificChildSet, allComponentNames)) {
785 if (ts.isExpressionStatement(node) && ts.isEtsComponentExpression(node.expression) &&
790 if (ts.isExpressionStatement(node) && ts.isEtsComponentExpression(node.expression) &&
798 function collectComponentProps(node: ts.StructDeclaration, judgeInitializeInEntry: boolean): void {
818 export function getComponentSet(node: ts.StructDeclaration, judgeInitializeInEntry: boolean): IComp…
843 function traversalComponentProps(node: ts.StructDeclaration, judgeInitializeInEntry: boolean,
853 if (ts.isPropertyDeclaration(item) && ts.isIdentifier(item.name)) {
872 if (ts.isMethodDeclaration(item) && item.name && ts.isIdentifier(item.name)) {
882 function collectionStates(node: ts.Decorator, judgeInitializeInEntry: boolean, decorator: string, n…
886 builderParams: Set<string>, initializationtName: ts.Expression, builderParamData: Set<string>,
937 function collectionlocalStorageParam(node: ts.Decorator, name: string,
940 if (node && ts.isCallExpression(node.expression) && node.expression.arguments &&
941 node.expression.arguments.length && ts.isStringLiteral(node.expression.arguments[0])) {
1226 function checkEntryComponent(node: ts.StructDeclaration, log: LogInfo[], sourceFile: ts.SourceFile)…
1229 if (node.modifiers[i].kind === ts.SyntaxKind.ExportKeyword) {
1239 function validateStateVariable(node: ts.MethodDeclaration): void {