Codelyzer: no-access-missing-member throwing when template accessing public properties on parent class

Created on 2 Apr 2017  路  12Comments  路  Source: mgechev/codelyzer

I have an Angular 4 app and I have a parent class for my custom components. There I have several public properties and methods which are used in the template of the custom components. The no-access-missing-member rule is throwing telling me those properties and methods don't exist on the class declaration.
Below is part of the files I'm using:

export class BaseComponent<T> implements ControlValueAccessor {
    disabled: boolean;
    focused: boolean;
    model: T;

        ...
}
@Component({
    selector: 'rm-input',
    templateUrl: './input.component.html',
    styleUrls: ['./input.component.scss']
})
export class InputComponent extends BaseComponent<string> implements OnChanges {

        ...

}



md5-6fd886d64620562838fa3ca6ceb25918



"@angular/MODULE": "^4.0.1" // several modules
"codelyzer": "^2.1.1"
"tslint": "^4.5.1"
"typescript": "^2.2.2"

Most helpful comment

It's a known issue in version 2. It'll be fixed in version 3 (it already is).

@mgechev I'm still getting this warning even when I'm now using v3.0.0. Was the fix actually merged?

Thanks!

All 12 comments

It's a known issue in version 2. It'll be fixed in version 3 (it already is).

Hi, version 2 and 3 of what?

Hi @mgechev, will this be fixed in a 2.x version aswell?

@trumbitta version 2 and 3 of this repo, codelyzer

@basst314 thanks, I should get more sleep. 馃樃

It's a known issue in version 2. It'll be fixed in version 3 (it already is).

@mgechev I'm still getting this warning even when I'm now using v3.0.0. Was the fix actually merged?

Thanks!

@mgechev This is issue is still reproducible on 3.0.1. Please check the repo: https://github.com/WiseBird/codelyzer_285

screen

You can run tslint by npm run tslint

@WiseBird got the same issue as well

@mgechev This issue should be reopen.
I see the issue was fixed and merged to master (master at that time): #238 . During the time master start to be out of sync with this commit. 3.0.0-beta.X versions were released with this. Now, these tags are completely out of sync with master and these tags are not at any branch. These changes were never merged with master and released as 3.0.0.
I didn't looked into the code deeply so I'm not able to say how easy it's to get it back to master.

@mscelina this rule will be removed because the language service and the compiler are responsible for finding & reporting compile-time errors.

@mgechev I wish this check could be done in tslint, because we don't do aot during development and we end up having to fix problems only when we do a production build which takes a lot longer in our case.

@juanmendes you can use the Angular language service for the purpose. Here it is.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

QuentinFchx picture QuentinFchx  路  3Comments

fabioemoutinho picture fabioemoutinho  路  5Comments

artaommahe picture artaommahe  路  3Comments

davidanaya picture davidanaya  路  4Comments

Bigous picture Bigous  路  4Comments