8000 feat: support typescript 3.6 (#915) · mgechev/codelyzer@dcb0218 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit dcb0218

Browse files
authored
feat: support typescript 3.6 (#915)
1 parent 9cd303c commit dcb0218

6 files changed

+13
-13
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"standard-version": "7.0.0",
8989
"ts-node": "8.4.1",
9090
"tslint": "5.20.0",
91-
"typescript": "3.4.5",
91+
"typescript": "~3.6.0",
9292
"zone.js": "0.10.2"
9393
},
9494
"peerDependencies": {

src/contextualDecoratorRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const getClassDecoratorName = (klass: Node): AngularClassDecoratorKeys | undefin
7373
};
7474

7575
const isDeclarationLike = (node: Node): node is DeclarationLike => {
76-
return isAccessor(node) || isMethodDeclaration(node) || isParameterPropertyDeclaration(node) || isPropertyDeclaration(node);
76+
return isAccessor(node) || isMethodDeclaration(node) || isParameterPropertyDeclaration(node, node.parent) || isPropertyDeclaration(node);
7777
};
7878

7979
const validateDeclaration = (walkContext: WalkContext, node: DeclarationLike): void => {

src/preferInlineDecoratorRule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ const callbackHandler = (walkContext: WalkContext<OptionDictionary>, node: Node)
196196
validateGetAccessorDeclaration(walkContext, node);
197197
} else if (methods && isMethodDeclaration(node)) {
198198
validateMethodDeclaration(walkContext, node);
199-
} else if (parameters && isParameter(node) && !isParameterPropertyDeclaration(node)) {
199+
} else if (parameters && isParameter(node) && !isParameterPropertyDeclaration(node, node.parent)) {
200200
validateParameterDeclaration(walkContext, node);
201-
} else if (parameterProperties && isParameterPropertyDeclaration(node)) {
201+
} else if (parameterProperties && isParameterPropertyDeclaration(node, node.parent)) {
202202
validateParameterPropertyDeclaration(walkContext, node);
203203
} else if (properties && isPropertyDeclaration(node)) {
204204
validatePropertyDeclaration(walkContext, node);

src/templateAccessibilityLabelForRule.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ class TemplateVisitorCtrl extends BasicTemplateAstVisitor {
133133

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

136-
this.controlComponents = new Set([...DEFAULT_CONTROL_COMPONENTS, ...controlComponents]);
137-
this.labelAttributes = new Set([...DEFAULT_LABEL_ATTRIBUTES, ...labelAttributes]);
138-
this.labelComponents = new Set([...DEFAULT_LABEL_COMPONENTS, ...labelComponents]);
136+
this.controlComponents = new Set([...DEFAULT_CONTROL_COMPONENTS.concat(controlComponents)]);
137+
this.labelAttributes = new Set([...DEFAULT_LABEL_ATTRIBUTES.concat(labelAttributes)]);
138+
this.labelComponents = new Set([...DEFAULT_LABEL_COMPONENTS.concat(labelComponents)]);
139139
}
140140

141141
visitElement(element: ElementAst, context: any): any {

src/util/isInteractiveElement.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ const interactiveRoles: any = new Set(
2828
})
2929
);
3030

31-
const nonInteractiveElementRoleSchemas = elementRoleEntries.reduce((accumulator: any, [elementSchema, roleSet]: any) => {
31+
const nonInteractiveElementRoleSchemas = elementRoleEntries.reduce((accumulator: any[], [elementSchema, roleSet]: any) => {
3232
if (Array.from(roleSet).every((role): boolean => nonInteractiveRoles.has(role))) {
3333
accumulator.push(elementSchema);
3434
}
3535
return accumulator;
3636
}, []);
3737

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

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

47-
const interactiveElementAXObjectSchemas = Array.from(elementAXObjects).reduce((accumulator: any, [elementSchema, AXObjectSet]: any) => {
47+
const interactiveElementAXObjectSchemas = Array.from(elementAXObjects).reduce((accumulator: any[], [elementSchema, AXObjectSet]: any) => {
4848
if (Array.from(AXObjectSet).every((role): boolean => interactiveAXObjects.has(role))) {
4949
accumulator.push(elementSchema);
5050
}

0 commit comments

Comments
 (0)
0