diff --git a/tools/tslint-rules/staticQueryRule.ts b/tools/tslint-rules/staticQueryRule.ts deleted file mode 100644 index 34b420edf5e..00000000000 --- a/tools/tslint-rules/staticQueryRule.ts +++ /dev/null @@ -1,38 +0,0 @@ -import * as ts from 'typescript'; -import * as Lint from 'tslint'; - -/** - * Rule which enforces that all queries are explicitly marked as static or non-static. - */ -export class Rule extends Lint.Rules.AbstractRule { - apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { - return this.applyWithWalker(new Walker(sourceFile, this.getOptions())); - } -} - -class Walker extends Lint.RuleWalker { - visitPropertyDeclaration(node: ts.PropertyDeclaration) { - const childQueryDecorator = node.decorators && node.decorators.find(decorator => { - const expression = (decorator.expression as ts.CallExpression); - const name = expression && expression.expression.getText(); - return name === 'ViewChild' || name === 'ContentChild'; - }); - - if (childQueryDecorator) { - const options = (childQueryDecorator.expression as ts.CallExpression).arguments[1]; - - if (!options || !ts.isObjectLiteralExpression(options) || - !this._getObjectProperty(options, 'static')) { - this.addFailureAtNode(childQueryDecorator, - 'Queries have to explicitly set the `static` option.'); - } - } - - super.visitPropertyDeclaration(node); - } - - /** Gets the node of an object property by name. */ - private _getObjectProperty(node: ts.ObjectLiteralExpression, name: string) { - return node.properties.find(property => (property.name as ts.Identifier).getText() === name); - } -} diff --git a/tslint.json b/tslint.json index 3ccf012d331..c8e5e1b6a20 100644 --- a/tslint.json +++ b/tslint.json @@ -104,7 +104,6 @@ "ng-on-changes-property-access": true, "rxjs-imports": true, "require-breaking-change-version": true, - "static-query": true, "no-host-decorator-in-concrete": [ true, "HostBinding",