Skip to content

Commit ae420af

Browse files
justin808claude
andcommitted
Fix eslint-disable syntax for file-level rules before 'use client'
File-level ESLint rules require block comment /* */ syntax, not single-line //. Update RspackRscPlugin regex to also recognize block comments before 'use client' directives. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2f3c42c commit ae420af

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

client/app/bundles/comments/components/SimpleCommentScreen/ror_components/SimpleCommentScreen.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// eslint-disable max-classes-per-file
1+
/* eslint-disable max-classes-per-file */
22
'use client';
33

44
import React from 'react';

config/webpack/rspackRscPlugin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ function hasUseClientDirective(filePath) {
2424
fs.closeSync(fd);
2525

2626
const head = buf.toString('utf-8');
27-
// Check for 'use client' as the first statement (with or without semicolons/quotes)
28-
result = /^(?:\s*\/\/[^\n]*\n)*\s*['"]use client['"]/.test(head);
27+
// Check for 'use client' as the first statement.
28+
// Allow comments (single-line // or block /* */) before the directive.
29+
result = /^(?:\s*(?:\/\/[^\n]*\n|\/\*[\s\S]*?\*\/))*\s*['"]use client['"]/.test(head);
2930
} catch (_) {
3031
// file doesn't exist or can't be read
3132
}

0 commit comments

Comments
 (0)