goetzrobin / spartan

Cutting-edge tools powering Angular full-stack development.
https://spartan.ng
MIT License
1.22k stars 133 forks source link

Use of host metadata #146

Closed corentinclichy closed 6 months ago

corentinclichy commented 6 months ago

Please provide the environment you discovered this bug in.

NX@latest angular@latest

Which area/package is the issue in?

typography

Description

Hi,

When I install primitives for typography, for example, I get the host declared as metadata.

Please provide the exception or error you saw

I get an Eslint error: 

**Use @HostBinding or @HostListener rather than the `host` metadata property (https://angular.io/styleguide#style-06-03)**

Other information

No response

I would be willing to submit a PR to fix this issue

goetzrobin commented 6 months ago

The Angular team is actually now recommending to use host over HostBinding and HostListener. Here is the documentation that states this: https://angular.dev/guide/components/host-elements#the-hostbinding-and-hostlistener-decorators We are also adhering to this new standard and use host. You can disable the eslint rule for the spartan libraries that are created by the CLI by adding this to your .eslintrc.json:

{
    "overrides": [{
        "files": ["*.ts"],
        "rules": {
            "@angular-eslint/no-host-metadata-property": 0,
            ...
            }
        }]
}
corentinclichy commented 6 months ago

Ok thanks a lot for the support