website refactor

This commit is contained in:
2026-01-17 18:28:10 +01:00
parent 6d57f8b1ce
commit 64d9e7fd16
44 changed files with 1729 additions and 415 deletions

View File

@@ -159,8 +159,12 @@ module.exports = {
},
},
create(context) {
const sourceCode = context.getSourceCode();
const hasUseClient = sourceCode.getText().includes("'use client'") || sourceCode.getText().includes('"use client"');
return {
CallExpression(node) {
if (hasUseClient) return;
if (node.callee.type === 'MemberExpression' &&
['sort', 'filter', 'reduce'].includes(node.callee.property.name) &&
!isInComment(node) &&
@@ -273,8 +277,12 @@ module.exports = {
},
},
create(context) {
const sourceCode = context.getSourceCode();
const hasUseClient = sourceCode.getText().includes("'use client'") || sourceCode.getText().includes('"use client"');
return {
FunctionDeclaration(node) {
if (hasUseClient) return;
// Skip if this is the main component (default export or ends with Page/Template)
const filename = context.getFilename();
const isMainComponent =
@@ -294,6 +302,7 @@ module.exports = {
}
},
VariableDeclarator(node) {
if (hasUseClient) return;
// Skip if this is the main component
const isMainComponent =
(node.parent && node.parent.parent && node.parent.parent.type === 'ExportDefaultDeclaration') ||
@@ -329,8 +338,12 @@ module.exports = {
},
},
create(context) {
const sourceCode = context.getSourceCode();
const hasUseClient = sourceCode.getText().includes("'use client'") || sourceCode.getText().includes('"use client"');
return {
NewExpression(node) {
if (hasUseClient) return;
if (node.callee.type === 'Identifier' &&
/^[A-Z]/.test(node.callee.name) &&
!node.callee.name.endsWith('PageQuery') &&