Skip to content

feat: New rule: tag-no-obsolete #1660

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

Merged
merged 2 commits into from
Jun 17, 2025
Merged

Conversation

coliff
Copy link
Member

@coliff coliff commented Jun 17, 2025

https://htmlhint.com/rules/tag-no-obsolete/

What it does:

Disallows the use of obsolete HTML5 tags
Detects both opening and closing tags
Case-insensitive detection (works with <CENTER>, <center>, etc.)

Obsolete tags detected:

applet, acronym, bgsound, dir, frame, frameset, noframes
isindex, keygen, listing, menuitem, nextid, noembed
plaintext, rb, rtc, strike, xmp, basefont, big
blink, center, font, marquee, multicol, nobr, spacer, tt

Files created/updated:

✅ src/core/rules/tag-no-obsolete.ts - Rule implementation
✅ src/core/rules/index.ts - Rule export
✅ src/core/types.ts - TypeScript interface
✅ test/rules/tag-no-obsolete.spec.js - Test suite
✅ website/src/content/docs/rules/tag-no-obsolete.mdx -
Documentation
✅ website/src/content/docs/rules/index.mdx - Rules index

Test results:

✅ All 4 tests pass
✅ Documentation test passes
✅ All existing tests still pass
✅ Manual testing confirms the rule works correctly

The rule is now fully integrated into HTMLHint and ready to use! Users can enable it by adding tag-no-obsolete: true to their HTMLHint configuration.

@coliff coliff requested a review from thedaviddias as a code owner June 17, 2025 01:40
@github-actions github-actions bot added the test label Jun 17, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new linting rule tag-no-obsolete to disallow the use of obsolete HTML5 tags. The implementation is clear, accompanied by comprehensive tests and documentation. I have a suggestion for a potential performance optimization in the rule implementation by using a Set for the list of obsolete tags, and another regarding the visibility of the new rule in the documentation index.

Copy link

codecov bot commented Jun 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (95e6a13) to head (c2e4863).
Report is 81 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #1660      +/-   ##
===========================================
+ Coverage   96.99%   100.00%   +3.00%     
===========================================
  Files           2         1       -1     
  Lines        1628         1    -1627     
  Branches      335         0     -335     
===========================================
- Hits         1579         1    -1578     
+ Misses         49         0      -49     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f40d329...c2e4863. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coliff coliff merged commit a925071 into main Jun 17, 2025
20 checks passed
@coliff coliff deleted the dev/coliff/feat-new-rule-tag-no-obsolete branch June 17, 2025 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant