Skip to content

Conversation

@hthief
Copy link
Contributor

@hthief hthief commented Feb 19, 2025

Why?

At bedrock we want to add translations with a static href value and the current linter never captures the open anchor tag.

eg: 'some link' will fail because it won't have a open tag captured

How?

Add a second capture group just for this case

@hthief hthief requested a review from yfrommelt February 19, 2025 14:20
@hthief hthief self-assigned this Feb 19, 2025
@coveralls
Copy link

coveralls commented Feb 19, 2025

Pull Request Test Coverage Report for Build 13433032158

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 8 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.04%) to 94.865%

Files with Coverage Reduction New Missed Lines %
packages/react-i18n/src/components/i18n.container.js 8 37.5%
Totals Coverage Status
Change from base Build 11362207902: 0.04%
Covered Lines: 192
Relevant Lines: 198

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 13414773993

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 94.865%

Totals Coverage Status
Change from base Build 11362207902: 0.04%
Covered Lines: 192
Relevant Lines: 198

💛 - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13414773993

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 94.865%

Totals Coverage Status
Change from base Build 11362207902: 0.04%
Covered Lines: 192
Relevant Lines: 198

💛 - Coveralls

@fdubost fdubost requested a review from flepretre February 19, 2025 14:22
Comment on lines 22 to 30
it('should validate anchor with static href value', () => {
expect(validateHTML({ validAnchor: '<a href="http://localhost">foo</a>' }, 'test', true)).toMatchSnapshot();
});

it('should validate anchor with interpolated href value', () => {
expect(
validateHTML({ validAnchor: '<a href="%(googlePrivacyUrl)s">Règles de confidentialité</a>' }, 'test', true),
).toMatchSnapshot();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

results are empty arrays, maybe we don't need snapshot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I tried to keep the same structure as the test above, to have some consistency, but maybe I can just have it check the error object to be false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed it to check for the array lenght to be zero

@hthief hthief requested a review from flepretre February 20, 2025 10:20
@flepretre flepretre merged commit 81c1186 into master Feb 21, 2025
5 checks passed
@flepretre flepretre deleted the fix-i18n-lint branch February 21, 2025 16:17
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.

6 participants