See gist:
https://gist.github.com/jsg2021/e61f6d4de37423842fd5b504b77967c9
babel-eslint@8 fixes it, but brings in babel@7 beta...
[email protected] does not crash.
I have same issue, but with no-unused-vars rule
type A = number
const a: A = 1
{
"parser": "babel-eslint",
"rules": {
"no-unused-vars": "error"
}
}
"dependencies": {
"babel-eslint": "^7.2.3",
"eslint": "^4.15.0"
}
Cannot read property 'type' of undefined
TypeError: Cannot read property 'type' of undefined
at isForInRef (/project/node_modules/eslint/lib/rules/no-unused-vars.js:406:24)
at variable.references.some.ref (/project/node_modules/eslint/lib/rules/no-unused-vars.js:443:21)
at Array.some (<anonymous>)
at isUsedVariable (/project/node_modules/eslint/lib/rules/no-unused-vars.js:442:40)
at collectUnusedVariables (/project/node_modules/eslint/lib/rules/no-unused-vars.js:565:26)
at collectUnusedVariables (/project/node_modules/eslint/lib/rules/no-unused-vars.js:572:17)
at Program:exit (/project/node_modules/eslint/lib/rules/no-unused-vars.js:617:36)
at listeners.(anonymous function).forEach.listener (/project/node_modules/eslint/lib/util/safe-emitter.js:47:58)
at Array.forEach (<anonymous>)
at Object.emit (/project/node_modules/eslint/lib/util/safe-emitter.js:47:38)
The latest eslint (4.18.2) still crashes with 7.2.3 in the same way. I'm trying to use 8.2.2, but it crashes too. See: #578 and #585
eslint 4.19.0 + babel-eslint 8.2.2 (and 7.2.3) work as expected for me.
Sent with GitHawk
I have eslint 4.19.1 & babel-eslint 7.2.3 and the bug is still present. I had to deactivate no-unused-vars
Same issue here with [email protected] and [email protected]
Recognized the problem with [email protected] and [email protected].
import {singleton} from 'aurelia-dependency-injection';
@singleton() // <---- Fails here
export class Timer {
timers = {};
Recognized the problem with [email protected] and [email protected].
import {singleton} from 'aurelia-dependency-injection'; @singleton() // <---- Fails here export class Timer { timers = {};
hi, are you resolved the question
Most helpful comment
I have same issue, but with
no-unused-varsruleindex.js
.eslintrc.json
package.json