- 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
44 lines
1.6 KiB
JavaScript
44 lines
1.6 KiB
JavaScript
import { createRule } from '../utils/index.js';
|
|
import path from 'path';
|
|
export default createRule('valid-style-parse', {
|
|
meta: {
|
|
docs: {
|
|
description: 'require valid style element parsing',
|
|
category: 'Possible Errors',
|
|
recommended: false
|
|
},
|
|
schema: [],
|
|
messages: {},
|
|
type: 'problem'
|
|
},
|
|
create(context) {
|
|
const sourceCode = context.sourceCode;
|
|
if (!sourceCode.parserServices.isSvelte) {
|
|
return {};
|
|
}
|
|
const cwd = `${context.cwd ?? process.cwd()}${path.sep}`;
|
|
return {
|
|
SvelteStyleElement(node) {
|
|
const styleContext = sourceCode.parserServices.getStyleContext();
|
|
if (styleContext.status === 'parse-error') {
|
|
// This will replace backslashes to forward slashes only
|
|
// if Node.js reports Windows style path separators
|
|
let message = styleContext.error.message.replace(cwd, '');
|
|
if (path.sep === '\\')
|
|
message = message.replace(/\\/g, '/');
|
|
context.report({
|
|
loc: node.loc,
|
|
message: `Error parsing style element. Error message: "${message}"`
|
|
});
|
|
}
|
|
if (styleContext.status === 'unknown-lang') {
|
|
context.report({
|
|
loc: node.loc,
|
|
message: `Found unsupported style element language "${styleContext.sourceLang}"`
|
|
});
|
|
}
|
|
}
|
|
};
|
|
}
|
|
});
|