Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eslint-plugin-template): handle 'innerHtml' input properly #242

Merged

Conversation

rafaelss95
Copy link
Member

Current behavior:

We can pass html content by using innerHTML and innerHtml. The later isn't currently ignored by the rule.

<h3 [innerHtml]="dangerouslySetHTML"></h3>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected behavior:

<h3 [innerHtml]="dangerouslySetHTML"></h3> // Pass

I also replaced conditionals by selectors to make it more readable and shorter.

@@ -21,7 +21,7 @@ ruleTester.run(RULE_NAME, rule, {
valid: [
'<h1>Heading Content!</h1>',
'<h2><app-content></app-content></h2>',
'<h3 [innerHTML]="dangerouslySetHTML"></h3>',
'<h3 [innerHtml]="dangerouslySetHTML"></h3>',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, there's already a test case on line 28 that test the innerHTML:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rafaelss95 rafaelss95 force-pushed the fix/accessibility-elements-content branch from 3bc9307 to 62d7275 Compare December 20, 2020 19:10
@rafaelss95 rafaelss95 force-pushed the fix/accessibility-elements-content branch from 62d7275 to 9440c42 Compare December 20, 2020 23:17
Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks a lot!

@JamesHenry
Copy link
Member

I need to report this flakiness to verdaccio, it's so frequent on the integrations test job, particular on master...

@JamesHenry JamesHenry merged commit 6d457ff into angular-eslint:master Dec 22, 2020
@JamesHenry
Copy link
Member

Reported it to verdaccio: verdaccio/verdaccio#2038

rafaelss95 added a commit to rafaelss95/angular-eslint that referenced this pull request Dec 22, 2020
@rafaelss95 rafaelss95 deleted the fix/accessibility-elements-content branch December 22, 2020 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants