Skip to content

Commit

Permalink
feat: support typescript 3.6 (#915)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgechev authored Oct 22, 2019
1 parent 9cd303c commit dcb0218
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"standard-version": "7.0.0",
"ts-node": "8.4.1",
"tslint": "5.20.0",
"typescript": "3.4.5",
"typescript": "~3.6.0",
"zone.js": "0.10.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/contextualDecoratorRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const getClassDecoratorName = (klass: Node): AngularClassDecoratorKeys | undefin
};

const isDeclarationLike = (node: Node): node is DeclarationLike => {
return isAccessor(node) || isMethodDeclaration(node) || isParameterPropertyDeclaration(node) || isPropertyDeclaration(node);
return isAccessor(node) || isMethodDeclaration(node) || isParameterPropertyDeclaration(node, node.parent) || isPropertyDeclaration(node);
};

const validateDeclaration = (walkContext: WalkContext, node: DeclarationLike): void => {
Expand Down
4 changes: 2 additions & 2 deletions src/preferInlineDecoratorRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ const callbackHandler = (walkContext: WalkContext<OptionDictionary>, node: Node)
validateGetAccessorDeclaration(walkContext, node);
} else if (methods && isMethodDeclaration(node)) {
validateMethodDeclaration(walkContext, node);
} else if (parameters && isParameter(node) && !isParameterPropertyDeclaration(node)) {
} else if (parameters && isParameter(node) && !isParameterPropertyDeclaration(node, node.parent)) {
validateParameterDeclaration(walkContext, node);
} else if (parameterProperties && isParameterPropertyDeclaration(node)) {
} else if (parameterProperties && isParameterPropertyDeclaration(node, node.parent)) {
validateParameterPropertyDeclaration(walkContext, node);
} else if (properties && isPropertyDeclaration(node)) {
validatePropertyDeclaration(walkContext, node);
Expand Down
6 changes: 3 additions & 3 deletions src/templateAccessibilityLabelForRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ class TemplateVisitorCtrl extends BasicTemplateAstVisitor {

const { controlComponents, labelAttributes, labelComponents } = (options.ruleArguments[0] || {}) as OptionDictionary;

this.controlComponents = new Set([...DEFAULT_CONTROL_COMPONENTS, ...controlComponents]);
this.labelAttributes = new Set([...DEFAULT_LABEL_ATTRIBUTES, ...labelAttributes]);
this.labelComponents = new Set([...DEFAULT_LABEL_COMPONENTS, ...labelComponents]);
this.controlComponents = new Set([...DEFAULT_CONTROL_COMPONENTS.concat(controlComponents)]);
this.labelAttributes = new Set([...DEFAULT_LABEL_ATTRIBUTES.concat(labelAttributes)]);
this.labelComponents = new Set([...DEFAULT_LABEL_COMPONENTS.concat(labelComponents)]);
}

visitElement(element: ElementAst, context: any): any {
Expand Down
6 changes: 3 additions & 3 deletions src/util/isInteractiveElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ const interactiveRoles: any = new Set(
})
);

const nonInteractiveElementRoleSchemas = elementRoleEntries.reduce((accumulator: any, [elementSchema, roleSet]: any) => {
const nonInteractiveElementRoleSchemas = elementRoleEntries.reduce((accumulator: any[], [elementSchema, roleSet]: any) => {
if (Array.from(roleSet).every((role): boolean => nonInteractiveRoles.has(role))) {
accumulator.push(elementSchema);
}
return accumulator;
}, []);

const interactiveElementRoleSchemas = elementRoleEntries.reduce((accumulator: any, [elementSchema, roleSet]: any) => {
const interactiveElementRoleSchemas = elementRoleEntries.reduce((accumulator: any[], [elementSchema, roleSet]: any) => {
if (Array.from(roleSet).some((role): boolean => interactiveRoles.has(role))) {
accumulator.push(elementSchema);
}
Expand All @@ -44,7 +44,7 @@ const interactiveElementRoleSchemas = elementRoleEntries.reduce((accumulator: an

const interactiveAXObjects = new Set(Array.from(AXObjects.keys()).filter(name => AXObjects.get(name).type === 'widget'));

const interactiveElementAXObjectSchemas = Array.from(elementAXObjects).reduce((accumulator: any, [elementSchema, AXObjectSet]: any) => {
const interactiveElementAXObjectSchemas = Array.from(elementAXObjects).reduce((accumulator: any[], [elementSchema, AXObjectSet]: any) => {
if (Array.from(AXObjectSet).every((role): boolean => interactiveAXObjects.has(role))) {
accumulator.push(elementSchema);
}
Expand Down

0 comments on commit dcb0218

Please sign in to comment.