Closed NateScarlet closed 5 years ago
tslint-microsoft-contrib
import { Types } from 'mongoose'; export const foo: Types.Array<number> = new Types.Array();
with tslint.json configuration:
tslint.json
"extends": ["tslint-microsoft-contrib"], "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], "rules": { "trailing-comma": false, "no-relative-imports": false, "no-implicit-dependencies": [true, ["dev", "graphql-tools"]], "newline-per-chained-call": false, "no-console": false, "quotemark": false, "export-name": [true, { "allow": ["resolvers"] }], "no-backbone-get-set-outside-model": false, "no-unsafe-any": false, "strict-boolean-expressions": false, "typedef": [ true, "call-signature", "arrow-call-signature", "parameter", // "arrow-parameter", "property-declaration", "variable-declaration", "member-variable-declaration", "object-destructuring", "array-destructuring" ], "match-default-export-name": false }
Got Replace Array constructor with an array literal: new Types.Array() (prefer-array-literal)tslint(prefer-array-literal)
Replace Array constructor with an array literal: new Types.Array() (prefer-array-literal)tslint(prefer-array-literal)
Got nothing
Good find @NateScarlet! Looks like the node should not be complained on if its .parent is a ts.PropertyAccessExpression.
.parent
ts.PropertyAccessExpression
Bug Report
tslint-microsoft-contrib
version: 6.1.0-beta2TypeScript code being linted
with
tslint.json
configuration:Actual behavior
Got
Replace Array constructor with an array literal: new Types.Array() (prefer-array-literal)tslint(prefer-array-literal)
Expected behavior
Got nothing