- Delete old Vite+Svelte frontend - Initialize new SvelteKit project with TypeScript - Configure Tailwind CSS v4 + DaisyUI - Implement JWT authentication with auto-refresh - Create login page with form validation (Zod) - Add protected route guards - Update Docker configuration for single-stage build - Add E2E tests with Playwright (6/11 passing) - Fix Svelte 5 reactivity with $state() runes Known issues: - 5 E2E tests failing (timing/async issues) - Token refresh implementation needs debugging - Validation error display timing
63 lines
2.1 KiB
JavaScript
63 lines
2.1 KiB
JavaScript
import { createRule } from '../utils/index.js';
|
|
export default createRule('no-restricted-html-elements', {
|
|
meta: {
|
|
docs: {
|
|
description: 'disallow specific HTML elements',
|
|
category: 'Stylistic Issues',
|
|
recommended: false,
|
|
conflictWithPrettier: false
|
|
},
|
|
schema: {
|
|
type: 'array',
|
|
items: {
|
|
oneOf: [
|
|
{ type: 'string' },
|
|
{
|
|
type: 'object',
|
|
properties: {
|
|
elements: {
|
|
type: 'array',
|
|
items: {
|
|
type: ['string']
|
|
},
|
|
uniqueItems: true,
|
|
minItems: 1
|
|
},
|
|
message: { type: 'string', minLength: 1 }
|
|
},
|
|
additionalProperties: false,
|
|
minItems: 1
|
|
}
|
|
]
|
|
},
|
|
uniqueItems: true,
|
|
minItems: 1
|
|
},
|
|
messages: {},
|
|
type: 'suggestion'
|
|
},
|
|
create(context) {
|
|
return {
|
|
SvelteElement(node) {
|
|
if (node.kind !== 'html')
|
|
return;
|
|
const { name } = node;
|
|
if (name.type !== 'SvelteName')
|
|
return;
|
|
for (const option of context.options) {
|
|
const message = option.message || `Unexpected use of forbidden HTML element ${name.name}.`;
|
|
const elements = option.elements || [option];
|
|
for (const element of elements) {
|
|
if (element === name.name) {
|
|
context.report({
|
|
message,
|
|
node: node.startTag
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|
|
});
|