TypeError: Cannot read property 'AbstractRule' of undefined
facing blocking issue when trying to use codelyzer in my projects.
Stack is
TypeError: Cannot read property 'AbstractRule' of undefined
at Object.
I'm using libraries as described in attached package.zip
can't seem to be able to attach zip I'm afraid. So here's my package.json deps part:
"dependencies": { "@angular/common": "~2.4", "@angular/compiler": "~2.4", "@angular/core": "~2.4", "@angular/forms": "~2.4", "@angular/http": "~2.4", "@angular/platform-browser": "~2.4", "@angular/platform-browser-dynamic": "~2.4", "@angular/router": "~3.4", "core-js": "~2.4.1", "lodash": "~4", "ng2-translate": "~5", "oblique-ui": "1.3.0", "rxjs": "~5.0", "ts-helpers": "~1.1", "zas-web-components": "~0", "zone.js": "~0.7" }
Question is "is it a known bug ? maybe tslint / codelyzer don't support angular 2.4 yet ?" Thanks !
It does, you need codelyzer 2.0.0-beta.4.
that's the one I'm using... Any clue / adivce I can investigate in order to solve this ? Thanks
You need tslint@^4.0.0.
using 4.2.0. my command-line: "tslint "components/**/*.ts" -o linters/tslint.txt -t verbose"
Use ./node_modules/.bin/tslint "components/**/*.ts" -o linters/tslint.txt -t verbose
or
npm i -g tslint@^4.2.0 and run tslint "components/**/*.ts" -o linters/tslint.txt -t verbose.
Most likely your global tslint is older version.
exactly the same result (tslint is installed globally and same version locally). As you closed the issue I suppose I have missed something. Still got the issue on 2 projects. Will note here if I can find a solution.
It's a version mismatch between codelyzer and tslint.
You can try the "Custom setup" in another directory and verify if everything works together.
So this is the end. Thanks for helping you are totally right I had a version mismatch with tslint. I ended specifying tslint+codelyzer in the dev dependencies of my projects in order to make sure each of them is using consistent versions in all linters. my current versions are tslint 4.2.0 and codelyzer-2.0.0-beta.4.
Awesome! I am glad it worked in the end.
I was seeing this issue with the atom-typescript plugin, every time i typed a key an error message appeared which was more than a little annoying
You solution worked for me, thanks
config.zip
Facing the same issue with the following configuration in my package.json.
Developing angular application with Gulp Build tool and systemjs config.