Tslint will pass without errors, but console get's lots of TypeError messages.
This is mitigated by turning jsx-key off, "jsx-key": true, , but I wanna use that rule 👍
command:
tslint --project tsconfig.json --format codeFrame
console output:
TypeError: Cannot read property 'map' of undefined
at hasKeyProp (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:96:9)
at checkIteratorElement (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:87:42)
at cb (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:68:21)
at visitNode (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14197:20)
at Object.forEachChild (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14333:24)
at cb (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:83:19)
at visitNode (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14197:20)
at Object.forEachChild (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14544:21)
at cb (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:83:19)
at visitEachNode (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14209:30)
TypeError: Cannot read property 'map' of undefined
at hasKeyProp (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:96:9)
at checkIteratorElement (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:87:42)
at cb (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:74:29)
at visitNode (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14197:20)
at Object.forEachChild (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14333:24)
at cb (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:83:19)
at visitNode (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14197:20)
at Object.forEachChild (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14544:21)
at cb (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:83:19)
at visitEachNode (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14209:30)
TypeError: Cannot read property 'map' of undefined
at hasKeyProp (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:96:9)
at checkIteratorElement (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:87:42)
at cb (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:68:21)
at visitNode (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14197:20)
at Object.forEachChild (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14333:24)
at cb (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:83:19)
at visitNode (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14197:20)
at Object.forEachChild (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14419:24)
at cb (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:83:19)
at visitEachNode (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14209:30)
TypeError: Cannot read property 'map' of undefined
at hasKeyProp (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:96:9)
at checkIteratorElement (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:87:42)
at cb (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:68:21)
at visitNode (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14197:20)
at Object.forEachChild (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14333:24)
at cb (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:83:19)
at visitNode (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14197:20)
at Object.forEachChild (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14373:21)
at cb (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/tslint-react/rules/jsxKeyRule.js:83:19)
at visitNode (/mnt/c/Users/hoche/Documents/Devel/embedit/lossevents-ui/node_modules/typescript/lib/typescript.js:14197:20)
tslint.json:
{
"extends": [
"tslint-react"
],
"jsRules": {},
"rulesDirectory": [],
"rules": {
// override tslint-react rules
"jsx-boolean-value": [
true,
"never"
],
"jsx-key": true,
// this should be in tslint-prettier
"jsx-equals-spacing": false,
// override tsling-config-standard
"no-use-before-declare": false,
// our core ts-lint rules
"prefer-template": true,
"forin": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-shadowed-variable": true,
"no-string-literal": true,
"no-unnecessary-initializer": true,
"no-magic-numbers": true,
"no-require-imports": true,
"no-duplicate-super": true,
"no-boolean-literal-compare": true,
"no-invalid-this": [
true,
"check-function-in-method"
],
"no-duplicate-imports": true,
"ordered-imports": [
true
],
"newline-before-return": true,
"object-literal-shorthand": true,
"typeof-compare": true,
"arrow-return-shorthand": [
true
],
"prefer-object-spread": true,
"prefer-for-of": true,
"prefer-const": true,
"prefer-method-signature": true,
// TS specific types rules
"no-inferrable-types": [
true
],
"callable-types": true,
"no-namespace": [
true,
"allow-declarations"
],
"interface-name": [
false
],
"ban-types": [
true,
[
"Object",
"Avoid using the `Object` type. Did you mean `object`?"
],
[
"Function",
"Avoid using the `Function` type. Prefer a specific function type, like `() => void`."
],
[
"Boolean",
"Avoid using the `Boolean` type. Did you mean `boolean`?"
],
[
"Number",
"Avoid using the `Number` type. Did you mean `number`?"
],
[
"String",
"Avoid using the `String` type. Did you mean `string`?"
],
[
"Symbol",
"Avoid using the `Symbol` type. Did you mean `symbol`?"
],
[
"Array",
"Avoid using the `Array<T>` type. Use 'type[]' instead."
]
]
}
}
packages:
Tslint will pass without errors, but console get's lots of
TypeError
messages.This is mitigated by turning
jsx-key
off,"jsx-key": true,
, but I wanna use that rule 👍command:
tslint --project tsconfig.json --format codeFrame
console output:
tslint.json:
tsconfig: