davidcalhoun/eslint-plugin-test-selectors

Test selector is not working in angular projects.

SunilManthenaG01 opened this issue · 4 comments

Hi,
I am trying to add this plugin to the angular project (v12). Not successfull as of now.
I extended both angular HTML rule and test selector rule angular rules are working but not the test-selector rules.

In my .eslintrc.json file I added the plugin as recommended by the documentation.

image

Here is my html
image

when I run ng lint I am not getting the lint error.

image

Is there anything else I am missing here?

Hi, Can I get any help on this one, please?

Sorry for the delay - this plugin lints JSX only. I'll update the readme to make this more clear.

@davidcalhoun thank you for the update. Do you know any other plugin which can do the same thing on HTML?

@SunilManthenaG01 Apologies for the delay! I'm not familiar with anything similar. My instinct for your Angular project would be to take a look at how they check the HTML attributes in angular-eslint - you could probably follow the same pattern and write a custom rule! E.g. take at the code for their template-accessibility-alt-text rule.