Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support typescript 3.6 #915

Merged
merged 1 commit into from Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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
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
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
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