Skip to content

Conversation

@yeonjuan
Copy link
Owner

Checklist

Description

@yeonjuan yeonjuan requested a review from Copilot November 26, 2025 16:34
Copilot finished reviewing on behalf of yeonjuan November 26, 2025 16:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issue #453 by adding support for checking closing tags on <script> and <style> elements in the require-closing-tags rule. Previously, the rule only checked regular HTML tags but didn't handle these special tag types that have their own AST node types.

Key Changes:

  • Added ScriptTag and StyleTag node type handling to the rule implementation
  • Refactored the checking function to support multiple tag node types
  • Added test coverage for both valid (closed) and invalid (unclosed) script/style tags

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/eslint-plugin/lib/rules/require-closing-tags.js Added support for ScriptTag and StyleTag node types by importing types, refactoring the checking function to handle all tag types, and adding visitor functions for script and style tags
packages/eslint-plugin/tests/rules/require-closing-tags.test.js Added test cases for valid closed script/style tags and invalid unclosed script/style tags to ensure the rule correctly validates these elements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yeonjuan yeonjuan merged commit 723896a into main Nov 27, 2025
5 checks passed
@codecov
Copy link

codecov bot commented Nov 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.71%. Comparing base (8f9afad) to head (a415cbb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #454   +/-   ##
=======================================
  Coverage   98.70%   98.71%           
=======================================
  Files          85       85           
  Lines        2790     2804   +14     
  Branches      764      768    +4     
=======================================
+ Hits         2754     2768   +14     
  Misses         36       36           
Flag Coverage Δ
unittest 98.71% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...es/eslint-plugin/lib/rules/require-closing-tags.js 98.46% <100.00%> (+0.21%) ⬆️
packages/eslint-plugin/lib/rules/utils/node.js 96.10% <100.00%> (+0.32%) ⬆️
🚀 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.

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.

[BUG] require-closing-tags misses unclosed `<script> tags

2 participants